PDA

View Full Version : how to convert this?


SnG.Scot_MisCuDI
30/12/2011, 05:09 AM
How can i convert this to zcmd
if(strcmp("/ckick", cmdtext, true, 5) == 0)
{
if(IsPlayerLuxAdmin(playerid)){ // Check if you're an admin.
if(!strlen(cmdtext[6])){
return SendClientMessage(playerid, 0xFFAA00AA, "Usage: /ckick [id]");
}
new targetid = strval(cmdtext[6]);
if(IsPlayerConnected(targetid)){
new string[128], playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME];
new string2[128];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(targetid, targetname, MAX_PLAYER_NAME);
format(string, 128, "** SERVER KICK: %s has been kicked from the server - Cheats Detected", targetname);
format(string2, -1, "** Dear %s cheats are {FF0000}not allowed. {FF00FF}-Admins of sng.",targetname);
SendClientMessageToAll(COL_ADMIN, string);
SendClientMessage(targetid, 0xFF00FFAA, string2);
SetPlayerPos(targetid, 219.1898,109.5359,999.0156);
SetPlayerInterior(targetid, 10);
SetPlayerFacingAngle(targetid, 359.5181);
Kick(targetid);

}
else{
return SendClientMessage(playerid, 0xFFAA00AA, "That player is not connected.");
}
}
else{
return SendClientMessage(playerid, 0xFFAA00AA, "SERVER: Unknown Command.");
}
return 1;
}

jamesbond007
30/12/2011, 05:54 AM
here... just indent it.
command(ckick,playerid,params[])
{
new id;
if(IsPlayerLuxAdmin(playerid))
{ // Check if you're an admin.
if(sscanf(params,"u",id))
{
return SendClientMessage(playerid, 0xFFAA00AA, "Usage: /ckick [id]");
}
else
{
if(IsPlayerConnected(id))
{
new string[128], playername[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME];
new string2[128];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(id, targetname, MAX_PLAYER_NAME);
format(string, 128, "** SERVER KICK: %s has been kicked from the server - Cheats Detected", targetname);
format(string2, -1, "** Dear %s cheats are {FF0000}not allowed. {FF00FF}-Admins of sng.",targetname);
SendClientMessageToAll(COL_ADMIN, string);
SendClientMessage(id, 0xFF00FFAA, string2);
SetPlayerPos(id, 219.1898,109.5359,999.0156);
SetPlayerInterior(id, 10);
SetPlayerFacingAngle(id, 359.5181);
Kick(targetid);

}
else return SendClientMessage(playerid, 0xFFAA00AA, "That player is not connected.");
}
}
else return SendClientMessage(playerid, 0xFFAA00AA, "SERVER: Unknown Command.");
return 1;
}