Wysłany: 2014-01-18, 15:20
Pikus2
Wiek: 29 Na forum: 4698 dni Posty: 244
Piwa : 5
Witam.
Niestety nie potrafie z??czyc komend
1komenda:
/wystaw
http://pastebin.com/kYjn78GU
2komenda:
/rachunek
http://pastebin.com/wEPTN2Xs
3komenda:
/faktura
http://pastebin.com/3mMthHqv
Chce aby te 3 komende z??czyli w jedn?
/rachunek
jak ktos z medyk?w uzyje
/rachunek
wyswietla sie graczowi:
Pracownik pogotowia %s wystawil ci rachunek za us?ugi w wysokosci %d$
a jak kt?rys z pomocy
uzyje to wyswietli:
Pracownik pomocy drogowej %s wystawil ci rachunek za us?ugi w wysokosci %d$
a jak ktos z taxi to:
Pracownik taxi %s wystawil ci rachunek za us?ugi w wysokosci %d$
za pomoc 5
Wysłany: 2014-01-18, 15:28
Maajk_El
PawnoMaster :)
Wiek: 29 Na forum: 4841 dni Posty: 162
Nick w MP: "Maajk_El"
Piwa : 2365
Do tego musia? by? zrobi? oddzielne komendy rachunek.
Nie lepiej Gracz %s wystawi? Ci rachunek w wysokosci %d.?
W tedy da si? jedn? komend? zrobi? na wszystko, ale do tego nawet nie wiem jakie masz zmienne..
Wysłany: 2014-01-19, 10:07
Pikus2
Wiek: 29 Na forum: 4698 dni Posty: 244
Piwa : 5
Nie nie lepiej tak jak m?wisz jak mozesz to z??cz je w 1 jak nie to trudno bedzie jako oddzielna
[ Dodano : 2014-01-19, 10:06 ]
ja widzia?em na jednym serwerze to dzia?a 1 komenda rachuenk na 3 frakcje tak jak ja chce.
nie mozna 3 takich samych komenda bo tylko jedna dzia?a.
Wysłany: 2014-01-19, 10:16
ToxiC.
Wiek: 28 Na forum: 5246 dni Posty: 3792
Piwa : 8590
Pawn
if ( strcmp ( cmd , "/wystaw" , true )== 0 )
{
if( gTeam [ playerid ] == TEAM_POMOC )
{
new moneyplayer ;
new moneyplus ;
mpt = strtok ( cmdtext , idx );
if(! strlen ( mpt ))
{
SendClientMessage ( playerid , COLOR_YELLOW , "/wystaw [ID gracza] [suma]" );
}
else
{
moneyplayer = strval ( mpt );
mpt = strtok ( cmdtext , idx );
if(! strlen ( mpt ))
{
SendClientMessage ( playerid , COLOR_YELLOW , "Z?a waluta" );
}
else
{
moneyplus = strval ( mpt );
new moneyplayername [ MAX_PLAYER_NAME ];
GetPlayerName ( moneyplayer , moneyplayername , sizeof ( moneyplayername ));
printf (string);
format ( string , sizeof (string), "Wystawi?e? rachunek graczowi %s w wysoko?ci %d$ " , moneyplayername , moneyplus );
SendClientMessage ( playerid , COLOR_YELLOW , string );
format ( string , sizeof (string), "Pracownik pomocy drogowej %s wystawil ci rachunek za us?ugi w wysokosci %d$" , PlayerName ( playerid ), moneyplus );
SendClientMessage ( moneyplayer , COLOR_SZARY , string );
GivePlayerMoney ( moneyplayer , - moneyplus );
}
}
}
else
{
if( gTeam [ playerid ] == TEAM_MEDYK ){
new moneyplayer ;
new moneyplus ;
mpt = strtok ( cmdtext , idx );
if(! strlen ( mpt )) {
SendClientMessage ( playerid , COLOR_YELLOW , "/wystaw [ID gracza] [suma]" );
} else {
moneyplayer = strval ( mpt );
mpt = strtok ( cmdtext , idx );
if(! strlen ( mpt )) {
SendClientMessage ( playerid , COLOR_YELLOW , "Z?a waluta" );
} else {
moneyplus = strval ( mpt );
new moneyplayername [ MAX_PLAYER_NAME ];
GetPlayerName ( moneyplayer , moneyplayername , sizeof ( moneyplayername ));
printf (string);
format ( string , sizeof (string), "Wystawi?e? rachunek graczowi %s w wysoko?ci %d$ " , moneyplayername , moneyplus );
SendClientMessage ( playerid , COLOR_YELLOW , string );
format ( string , sizeof (string), "Pracownik pogotowia %s wystawil ci rachunek za us?ugi w wysokosci %d$" , PlayerName ( playerid ), moneyplus );
SendClientMessage ( moneyplayer , COLOR_RED , string );
GivePlayerMoney ( moneyplayer , - moneyplus );
}
}
}
}
else
{
if( gTeam [ playerid ] == TEAM_TAXI ){
new moneyplayer ;
new moneyplus ;
mpt = strtok ( cmdtext , idx );
if(! strlen ( mpt )) {
SendClientMessage ( playerid , COLOR_YELLOW , "/wystaw [ID gracza] [suma]" );
} else {
moneyplayer = strval ( mpt );
mpt = strtok ( cmdtext , idx );
if(! strlen ( mpt )) {
SendClientMessage ( playerid , COLOR_YELLOW , "Z?a waluta" );
} else {
moneyplus = strval ( mpt );
new moneyplayername [ MAX_PLAYER_NAME ];
GetPlayerName ( moneyplayer , moneyplayername , sizeof ( moneyplayername ));
printf (string);
format ( string , sizeof (string), "Wystawi?e? rachunek graczowi %s w wysoko?ci %d$ " , moneyplayername , moneyplus );
SendClientMessage ( playerid , COLOR_YELLOW , string );
format ( string , sizeof (string), "Pracownik taxi %s wystawil ci rachunek za us?ugi w wysokosci %d$" , PlayerName ( playerid ), moneyplus );
SendClientMessage ( moneyplayer , COLOR_YELLOW , string );
GivePlayerMoney ( moneyplayer , - moneyplus );
}
}
}
}
return 1 ;
}
? ?
Wysłany: 2014-01-19, 14:35
Pikus2
Wiek: 29 Na forum: 4698 dni Posty: 244
Piwa : 5
Kod: if (strcmp(cmd, "/wystaw", true)==0)
{
if(gTeam[playerid] == TEAM_POMOC)
{
new moneyplayer;
new moneyplus;
mpt = strtok(cmdtext, idx);
if(!strlen(mpt))
{
SendClientMessage(playerid, COLOR_YELLOW, "/wystaw [ID gracza] [suma]");
}
else
{
moneyplayer = strval(mpt);
mpt = strtok(cmdtext, idx);
if(!strlen(mpt))
{
SendClientMessage(playerid, COLOR_YELLOW, "Z?a waluta");
}
else
{
moneyplus = strval(mpt);
new moneyplayername[MAX_PLAYER_NAME];
GetPlayerName(moneyplayer,moneyplayername,sizeof(moneyplayername));
printf(string);
format(string, sizeof(string), "Wystawi?e? rachunek graczowi %s w wysoko?ci %d$ ",moneyplayername, moneyplus);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Pdek %s wystawil ci rachunek za us?ugi w wysokosci %d$",PlayerName(playerid),moneyplus);
SendClientMessage(moneyplayer, c_Pd, string);
GivePlayerMoney(moneyplayer, -moneyplus);
}
}
}
else
{
if(gTeam[playerid] == TEAM_MEDYK){
new moneyplayer;
new moneyplus;
mpt = strtok(cmdtext, idx);
if(!strlen(mpt)) {
SendClientMessage(playerid, COLOR_YELLOW, "/wystaw [ID gracza] [suma]");
} else {
moneyplayer = strval(mpt);
mpt = strtok(cmdtext, idx);
if(!strlen(mpt)) {
SendClientMessage(playerid, COLOR_YELLOW, "Z?a waluta");
} else {
moneyplus = strval(mpt);
new moneyplayername[MAX_PLAYER_NAME];
GetPlayerName(moneyplayer,moneyplayername,sizeof(moneyplayername));
printf(string);
format(string, sizeof(string), "Wystawi?e? rachunek graczowi %s w wysoko?ci %d$ ",moneyplayername, moneyplus);
SendClientMessage(playerid, COLOR_YELLOW, string);
format(string, sizeof(string), "Pogotek %s wystawil ci rachunek za us?ugi w wysokosci %d$",PlayerName(playerid),moneyplus);
SendClientMessage(moneyplayer, COLOR_RED, string);
GivePlayerMoney(moneyplayer, -moneyplus);
}
}
}
}
return 1;
}
tak dzia?? a jak dodam z taxi juz nie dzia?a why?
Tagi: prosze :: złączenie :: tych :: komend
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: