20.02.2011, 22:14
(
Последний раз редактировалось hadzx; 21.02.2011 в 08:48.
)
ok so i have these commands heres code
its /akill [id] [reason] and kills them and ive discovered if you put the cmd 4letters example (/slap) then the reason is
Reason : %s
Like Normal But If You Have More Than 4 Letters
The Reason Becomes
Reason:0 %s
Heres Code
Please Help Thanks
thanks
its /akill [id] [reason] and kills them and ive discovered if you put the cmd 4letters example (/slap) then the reason is
Reason : %s
Like Normal But If You Have More Than 4 Letters
The Reason Becomes
Reason:0 %s
Heres Code
Please Help Thanks
Код:
if ( strcmp ( cmd , "/akill" , true ) == 0 && IsPlayerAdmin ( playerid ) ) { new tmp [ 256 ]; new message [ 256 ]; tmp = strtok ( cmdtext , idx ); if( ! strlen ( tmp ) ) { SendClientMessage ( playerid , 0xFF0000FF , "Usage: /akill [playerid] [reason]" ); return 1; } new giveplayerid = strval(tmp); tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "{FF66FF}**Kill: (%s) (ID) %d (Admin Kill) -> (%s) (ID) %d Reason: No Reason Given",GetName(playerid), playerid, GetName(giveplayerid), giveplayerid); SendClientMessageToAll(COLOR_WHITE, string); printf(string); new Float:killhealth; GetPlayerHealth(giveplayerid, killhealth); SetPlayerHealth(giveplayerid, killhealth-100); return 1; } else { format(string, sizeof(string), "{F81414}ERROR: ID %d Is Not Online/Found Please Recheck The ID", giveplayerid); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } } if(giveplayerid < 10) { strmid(message, cmdtext, 7, strlen(cmdtext)); } else { strmid(message, cmdtext, 8, strlen(cmdtext)); } if (IsPlayerConnected(giveplayerid)) { format(string, sizeof(string), "{FF66FF}**KILL: (%s) (ID) %d (Admin Kill) -> (%s) (ID) %d Reason:%s",GetName(playerid), playerid, GetName(giveplayerid), giveplayerid, message ); SendClientMessageToAll(COLOR_WHITE, string); printf(string); new Float:killhealth; GetPlayerHealth(giveplayerid, killhealth); SetPlayerHealth(giveplayerid, killhealth-100); return 1; } else { format(string, sizeof(string), "ERROR: ID %d Is Not Online/Found Please Recheck The ID", giveplayerid); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } }