Wysłany: 2012-01-31, 12:37
BBBay
It's a Programmer
Wiek: 28 Na forum: 5428 dni Posty: 97
Nick w MP: xBBBay
Piwa : 340
Chce tak aby gdy pisze /dajpkt i komus odejmuje punkty i dodaje temu policjanotwi te punkty co komus odjol
Kod:
if (strcmp(cmd, "/dajpkt", true)==0)
{
if(gTeam[playerid] == TEAM_POLICJA)
{
new tmp[256];
new string[256];
new scoreplayer;
new scoreplayerscore;
new scoreminus;
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, COLOR_WHITE, "Policja: /dajpkt [ID gracza] [punkty]");
} else {
scoreplayer = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, ZIELONY, "Policja: Z?e punkty");
} else {
if(strval(tmp) > 10) return SendClientMessage(playerid,-1,"Maksymalna ilo?? pkt karnych jednorazowo wynosi 10");
if(strval(tmp) < 0) return SendClientMessage(playerid,-1,"Minimalna ilo?? pkt karnych wynosi 0");
scoreminus = strval(tmp);
new scoreplayername[MAX_PLAYER_NAME];
GetPlayerName(scoreplayer,scoreplayername,sizeof(scoreplayername));
format(string, sizeof(string), "Policjant %s (id:%d) dal %d punktow karnych graczowi %s (id: %d).",PlayerName(playerid),playerid, scoreminus, scoreplayername ,giveplayerid);
printf(string);
format(string, sizeof(string), "Policja: Da?e? %d punkt?w karnych graczowi %s",scoreminus, scoreplayername);
SendClientMessage(playerid, COLOR_GREEN, string);
scoreplayerscore = GetPlayerScore(scoreplayer);
scoreplayerscore =SetPlayerScore(scoreplayer, scoreplayerscore-scoreminus);
tmp = strtok(cmdtext, idx);
}
}
}
return 1;
}
Wysłany: 2012-01-31, 13:08
karol170396
Wiek: 33 Na forum: 5643 dni Posty: 580
Nick w MP: Journey
Piwa : 1520
Tagi: mandat
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: