if(strcmp(cmdtext,"/Suspect",true) == 0 || strcmp(cmdtext,"/Su",true) == 0) {
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, COLOR_GREEN, "USAGE: /Suspect [PlayerID/PlayerName]");
return 1;
}
tmp = strtok(cmdtext, idx);
GivePlayerID = ReturnUser(tmp);
if(IsPlayerConnected(GivePlayerID))
{
if(GivePlayerID != INVALID_PLAYER_ID)
{
if(Suspect[GivePlayerID] == 0)return Suspect[GivePlayerID] = 1 ,SetPlayerWantedLevel(GivePlayerID, 1) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 1 ");
if(Suspect[GivePlayerID] == 1)return Suspect[GivePlayerID] = 2 ,SetPlayerWantedLevel(GivePlayerID, 2) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 2 ");
if(Suspect[GivePlayerID] == 2)return Suspect[GivePlayerID] = 3 ,SetPlayerWantedLevel(GivePlayerID, 3) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 3 ");
if(Suspect[GivePlayerID] == 3)return Suspect[GivePlayerID] = 4 ,SetPlayerWantedLevel(GivePlayerID, 4) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 4 ");
if(Suspect[GivePlayerID] == 4)return Suspect[GivePlayerID] = 5 ,SetPlayerWantedLevel(GivePlayerID, 5) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 5 ");
if(Suspect[GivePlayerID] == 5)return Suspect[GivePlayerID] = 6 ,SetPlayerWantedLevel(GivePlayerID, 6) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 6 ") ,SetPlayerColor(GivePlayerID, COLOR_RED) ,SetPlayerMarkerForPlayer(i, playerid, COLOR_RED);
if(Suspect[GivePlayerID] == 6)return SendClientMessage(playerid, COLOR_ORANGE,"You Cant Use This Command This Player Alredy Have Level Wanted: 6");
}
}
}
return 1;
}
new cmd[256]; new tmp[256];
new GivePlayerID, idx;
new vehicleid = GetPlayerVehicleID(playerid);
tmp = strtok(cmdtext, idx);
cmd = strtok(cmdtext, idx);
GivePlayerID = ReturnUser(tmp);
if(strcmp(cmd, "/suspectlvl",true)==0 || strcmp(cmd, "/sl",true)==0) { new tmp[256]; new msg[MAX_STRING]; if(PlayerInfo[playerid][playerteam]==COPS) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientUsage(playerid, cmd, "[Name/ID]"); return 1; } if(!IsNumeric(tmp) && (PlayerID(tmp)==-2 || PlayerID(tmp)==-1)) { SendClientError(playerid, "Not found. Invalid part of name or more than one result"); return 1; } if(!IsNumeric(tmp) && PlayerID(tmp)>=0) giveplayerid = PlayerID(tmp); if(IsNumeric(tmp)) giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)) { SendClientError(playerid, "Not found."); return 1; } if(GetPlayerWantedLevel(giveplayerid)<5) { SetPlayerWantedLevel(giveplayerid,GetPlayerWantedLevel(giveplayerid)+1); format(msg,sizeof(msg),"%s wanted level: %d",PlayerName(giveplayerid),GetPlayerWantedLevel(giveplayerid)); SendClientMessage(playerid, COLOR_PLAYER_LIGHTBLUE,msg); return 1; } else SendClientError(playerid, "Already wanted level 5"); } else { SendClientError(playerid, "You are not allowed to use this command"); } return 1; }
if(strcmp(cmd, "/clearlvl",true)==0 || strcmp(cmd, "/cl",true)==0){ new tmp[256]; new msg[MAX_STRING]; if(PlayerInfo[playerid][playerteam]==COPS){ tmp = strtok(cmdtext, idx); if(!strlen(tmp)){ SendClientUsage(playerid, cmd, "[Name/ID]"); return 1; } if(!IsNumeric(tmp) && (PlayerID(tmp)==-2 || PlayerID(tmp)==-1)){ SendClientError(playerid, "Not found. Invalid part of name or more than one result"); return 1; } if(!IsNumeric(tmp) && PlayerID(tmp)>=0) giveplayerid = PlayerID(tmp); if(IsNumeric(tmp)) giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)){ SendClientError(playerid, "Not found."); return 1; } if(GetPlayerWantedLevel(giveplayerid)>0){ SetPlayerWantedLevel(giveplayerid,GetPlayerWantedLevel(giveplayerid)-1); format(msg,sizeof(msg),"%s wanted level: %d",PlayerName(giveplayerid),GetPlayerWantedLevel(giveplayerid)); SendClientMessage(playerid, COLOR_PLAYER_LIGHTBLUE,msg); PlayerInfo[giveplayerid][wantedlevel]=GetPlayerWantedLevel(giveplayerid)-1; dUserSetINT(PlayerName(giveplayerid)).("wantedlevel",PlayerInfo[giveplayerid][wantedlevel]-1); return 1; } else SendClientError(playerid, "Error: Already wanted level 0"); } else { SendClientError(playerid, "You are not allowed to use this command"); } return 1; }
תנסה את זה יותר קצר ואני בטוח 100% שזה עובד
Code:
if(strcmp(cmd, "/suspectlvl",true)==0 || strcmp(cmd, "/sl",true)==0) { new tmp[256]; new msg[MAX_STRING]; if(PlayerInfo[playerid][playerteam]==COPS) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientUsage(playerid, cmd, "[Name/ID]"); return 1; } if(!IsNumeric(tmp) && (PlayerID(tmp)==-2 || PlayerID(tmp)==-1)) { SendClientError(playerid, "Not found. Invalid part of name or more than one result"); return 1; } if(!IsNumeric(tmp) && PlayerID(tmp)>=0) giveplayerid = PlayerID(tmp); if(IsNumeric(tmp)) giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)) { SendClientError(playerid, "Not found."); return 1; } if(GetPlayerWantedLevel(giveplayerid)<5) { SetPlayerWantedLevel(giveplayerid,GetPlayerWantedLevel(giveplayerid)+1); format(msg,sizeof(msg),"%s wanted level: %d",PlayerName(giveplayerid),GetPlayerWantedLevel(giveplayerid)); SendClientMessage(playerid, COLOR_PLAYER_LIGHTBLUE,msg); return 1; } else SendClientError(playerid, "Already wanted level 5"); } else { SendClientError(playerid, "You are not allowed to use this command"); } return 1; } Code:
if(strcmp(cmd, "/clearlvl",true)==0 || strcmp(cmd, "/cl",true)==0){ new tmp[256]; new msg[MAX_STRING]; if(PlayerInfo[playerid][playerteam]==COPS){ tmp = strtok(cmdtext, idx); if(!strlen(tmp)){ SendClientUsage(playerid, cmd, "[Name/ID]"); return 1; } if(!IsNumeric(tmp) && (PlayerID(tmp)==-2 || PlayerID(tmp)==-1)){ SendClientError(playerid, "Not found. Invalid part of name or more than one result"); return 1; } if(!IsNumeric(tmp) && PlayerID(tmp)>=0) giveplayerid = PlayerID(tmp); if(IsNumeric(tmp)) giveplayerid = strval(tmp); if(!IsPlayerConnected(giveplayerid)){ SendClientError(playerid, "Not found."); return 1; } if(GetPlayerWantedLevel(giveplayerid)>0){ SetPlayerWantedLevel(giveplayerid,GetPlayerWantedLevel(giveplayerid)-1); format(msg,sizeof(msg),"%s wanted level: %d",PlayerName(giveplayerid),GetPlayerWantedLevel(giveplayerid)); SendClientMessage(playerid, COLOR_PLAYER_LIGHTBLUE,msg); PlayerInfo[giveplayerid][wantedlevel]=GetPlayerWantedLevel(giveplayerid)-1; dUserSetINT(PlayerName(giveplayerid)).("wantedlevel",PlayerInfo[giveplayerid][wantedlevel]-1); return 1; } else SendClientError(playerid, "Error: Already wanted level 0"); } else { SendClientError(playerid, "You are not allowed to use this command"); } return 1; } |
if(!IsNumeric(tmp) && (PlayerID(tmp)==-2 || PlayerID(tmp)==-1))
{
SendClientError(playerid, "Not found. Invalid part of name or more than one result");
return 1;
}
if(!IsNumeric(tmp) && PlayerID(tmp)>=0) giveplayerid = PlayerID(tmp);
if(IsNumeric(tmp)) giveplayerid = strval(tmp);
if(!IsPlayerConnected(giveplayerid))
{
SendClientError(playerid, "Not found.");
return 1;
}
כעקרון לא, זה לא מהמוד שלי הפקודות האילו לא קיימות אצלי מורכבות אחרת לגמרי.
זה ממוד בסיסי אחר שאני עורך ליפעמים בשביל הפנאי, או סתם לערוך פקודה לפני שהיא ניכנסת לשרת שלי ולמוד שלי נסה להוסיף את זה לפקודה שלך [EDITED] PHP Code:
|
if(strcmp(cmdtext,"/Suspect",true) == 0 || strcmp(cmdtext,"/Su",true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)){
SendClientMessage(playerid, COLOR_GREEN, "USAGE: /Suspect [playerid/PlayerName]");
return 1;
}
// GivePlayerID = ReturnUser(tmp);
if(!IsNumeric(tmp) && playerid(tmp)>=0) GivePlayerID = playerid(tmp)
if(IsNumeric(tmp)) GivePlayerID = strval(tmp);
if(IsPlayerConnected(GivePlayerID))
{
if(GivePlayerID != INVALID_PLAYER_ID)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(Suspect[GivePlayerID] == 0)return Suspect[GivePlayerID] = 1 ,SetPlayerWantedLevel(GivePlayerID, 1) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 1 ");
if(Suspect[GivePlayerID] == 1)return Suspect[GivePlayerID] = 2 ,SetPlayerWantedLevel(GivePlayerID, 2) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 2 ");
if(Suspect[GivePlayerID] == 2)return Suspect[GivePlayerID] = 3 ,SetPlayerWantedLevel(GivePlayerID, 3) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 3 ");
if(Suspect[GivePlayerID] == 3)return Suspect[GivePlayerID] = 4 ,SetPlayerWantedLevel(GivePlayerID, 4) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 4 ");
if(Suspect[GivePlayerID] == 4)return Suspect[GivePlayerID] = 5 ,SetPlayerWantedLevel(GivePlayerID, 5) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 5 ");
if(Suspect[GivePlayerID] == 5)return Suspect[GivePlayerID] = 6 ,SetPlayerWantedLevel(GivePlayerID, 6) ,SendClientMessage(playerid, COLOR_ORANGE, "You Level Wanted Now Is: 6 ") ,SetPlayerColor(GivePlayerID, COLOR_RED) ,SetPlayerMarkerForPlayer(i, playerid, COLOR_RED);
if(Suspect[GivePlayerID] == 6)return SendClientMessage(playerid, COLOR_ORANGE,"You Cant Use This Command This Player Alredy Have Level Wanted: 6");
}
}
}
return 1;
}
C:\Users\pcx\Desktop\samp03e_svr_R2_win32\filterscripts\CopsSystem.pwn(283) : error 012: invalid function call, not a valid address
C:\Users\pcx\Desktop\samp03e_svr_R2_win32\filterscripts\CopsSystem.pwn(283) : warning 215: expression has no effect
C:\Users\pcx\Desktop\samp03e_svr_R2_win32\filterscripts\CopsSystem.pwn(283) : error 001: expected token: ";", but found ")"
C:\Users\pcx\Desktop\samp03e_svr_R2_win32\filterscripts\CopsSystem.pwn(283) : error 029: invalid expression, assumed zero
C:\Users\pcx\Desktop\samp03e_svr_R2_win32\filterscripts\CopsSystem.pwn(283) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
if(!IsNumeric(tmp) && playerid(tmp)>=0) GivePlayerID = playerid(tmp)
if(!IsNumeric(tmp) && playerid(tmp)>=0) GivePlayerID = playerid(tmp) ;
GivePlayerID = ReturnUser(tmp);
replace with
GivePlayerID = playerid(tmp)
PHP Code:
PHP Code:
|
GivePlayerID = ReturnUser(tmp);
replace with
GivePlayerID = playerid(tmp)
PHP Code:
|