how to convert this? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: how to convert this? (
/showthread.php?tid=307325)
how to convert this? -
SnG.Scot_MisCuDI - 30.12.2011
How can i convert this to zcmd
pawn Код:
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;
}
Re: how to convert this? -
jamesbond007 - 30.12.2011
here... just indent it.
pawn Код:
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;
}