Jump to content
  • 0

Question

Posted

Problemă întâlnită (descriere): Comanda /clear [ imi zice Nu esti politist]

Ero(area / rile) / warning-(ul / urile): --

Liniile de cod / sursa / script-ul: [pawn] if(strcmp(cmd, "/clear", true) == 0)

{

if(IsPlayerConnected(playerid))

{

if(gTeam[playerid] == 2)

{

if (!PlayerToPoint(3.0, playerid, 253.9280,69.6094,1003.6406))

{

SendClientMessage(playerid, COLOR_GRAD2, "Nu esti la sediul politiei!");

return 1;

}

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendUsage(playerid,"{1fab48}» Foloseste: {FFFFFF}/clear [playerid/PartOfName][reason]");

return 1;

}

giveplayerid = ReturnUser(tmp);

new length = strlen(cmdtext);

while ((idx < length) && (cmdtext[idx] <= ' '))

{

idx++;

}

new offset = idx;

new result[200];

while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))

{

result[idx - offset] = cmdtext[idx];

idx++;

}

result[idx - offset] = EOS;

for(new s = 0; s < num_words; s++)

{

new pos;

while((pos = strfind(result,Swears,true)) != -1) for(new i = pos, j = pos + strlen(Swears); i < j; i++)

{

result = '*';

}

}

if(!strlen(result))

{

SendUsage(playerid,"{1fab48}» Foloseste: {FFFFFF}/clear [playerid/PartOfName][reason]");

return 1;

}

if(IsPlayerConnected(giveplayerid))

{

if(giveplayerid != INVALID_PLAYER_ID)

{

if(giveplayerid == playerid) { SendClientMessage(playerid, COLOR_GREY, "Nu poti sa iti stergi singur stelele!"); return 1; }

GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));

GetPlayerName(playerid, sendername, sizeof(sendername));

format(string, sizeof(string), "* Politistul %s ti-a sters wanted-ul, motiv: %s.", sendername,result);

SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);

format(string, sizeof(string), "* %s i-a sters la %s wanted-ul, motiv: %s.", sendername, giveplayer, result);

SendRadioMessage(1, TEAM_BLUE_COLOR, string);

SendRadioMessage(2, TEAM_BLUE_COLOR, string);

SendRadioMessage(3, TEAM_BLUE_COLOR, string);

WantedPoints[giveplayerid] = 0;

WantedLevel[giveplayerid] = 0;

ClearCrime(giveplayerid);

SetPlayerWantedLevel(giveplayerid, 0);

PlayerData[giveplayerid][pWantedPoints] = WantedPoints[giveplayerid];

format(string, sizeof(string), "UPDATE players SET WantedPoints='%d' WHERE id=%d", PlayerData[giveplayerid][pWantedPoints], PlayerData[giveplayerid][pSQLID]);

mysql_query(string);

format(string, sizeof(string), "UPDATE players SET WantedLevel='%d' WHERE id=%d", WantedLevel[giveplayerid], PlayerData[giveplayerid][pSQLID]);

mysql_query(string);

if(gTeam[giveplayerid] == 4)

{

gTeam[giveplayerid] = 3;

SetPlayerToTeamColor(giveplayerid);

}

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "Acest jucator nu este conectat!");

}

}

else

{

SendClientMessage(playerid, COLOR_GREY, "Nu esti politist!");

}

}

return 1;

}[/pawn] 

Sau http://pastebin.com/mfFBsNHZ

Imagini / Video (optional):

Aţi încercat să rezolvaţi singur?: Sa schimb comanda, doar.

2 answers to this question

Recommended Posts

  • Administrator
Posted

Cum ai asta?

 

[pawn]if(gTeam[playerid] == 2)
{[/pawn]

 

Poti sa schimbi aia in PlayerInfo[playerid][pMember] == 1 sau cum ai tu in gamemode.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.