17.10.2010, 22:26
If i wanted to change this
Into an unsuspect command, All i would do is change
to
Right?
pawn Код:
if(strcmp(cmd, "/suspect", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /suspect [playerid] [crime]");
return 1;
}
giveplayerid = ReturnUser(tmp);
if (PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
{
if(IsPlayerConnected(giveplayerid))
{
if(giveplayerid != INVALID_PLAYER_ID)
{
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[USAGE:] /suspect [playerid] [crime]");
return 1;
}
if(CopOnDuty[playerid])
{
if(giveplayerid != playerid)
{
if(WantedPoints[giveplayerid] == 0) { WantedPoints[giveplayerid] = 3; }
else { WantedPoints[giveplayerid]+= 2; }
SetPlayerWantedLevelEx(giveplayerid,GetPlayerWantedLevelEx(giveplayerid)+1);
format(string, sizeof(string), "[INFO:] You have been suspected by %s, Reason: %s.", GetPlayerNameEx(playerid),result);
SendClientMessage(giveplayerid, COLOR_RED, string);
format(string, sizeof(string), "[INFO:] You have suspected %s, Reason: %s.", GetPlayerNameEx(giveplayerid),result);
SendClientMessage(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "[LSPD:] %s has suspected %s, Reason: %s.", GetPlayerNameEx(playerid),GetPlayerNameEx(giveplayerid),result);
SendFactionTypeMessage(1,COLOR_LSPD,string);
new location[MAX_ZONE_NAME];
GetPlayer2DZone(giveplayerid, location, MAX_ZONE_NAME);
format(string, sizeof(string), "[LSPD:] All units be on the lookout for %s - Person Last Seen: %s.", GetPlayerNameEx(giveplayerid),location);
SendFactionTypeMessage(1,COLOR_LSPD,string);
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You can't suspect yourself!");
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Your not on cop duty!");
}
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You are not in the correct faction.");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Invalid ID.");
return 1;
}
return 1;
}
pawn Код:
SetPlayerWantedLevelEx(giveplayerid,GetPlayerWantedLevelEx(giveplayerid)+1);
pawn Код:
SetPlayerWantedLevelEx(giveplayerid,GetPlayerWantedLevelEx(giveplayerid)-5);