How to change this to zcmd - 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 change this to zcmd (
/showthread.php?tid=327284)
How to change this to zcmd -
[LHT]Bally - 20.03.2012
how do i change this so it works using zcmd
pawn Код:
dcmd_makelht(playerid, params[])
{
if(PlayerInfo[playerid][Level] >= 5)
{
new tmp[256], Index;
tmp = strtok(params,Index);
if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /makelht [playerid]");
new player1 = strval(tmp);
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
new str[128];
GetPlayerName(player1, str, sizeof(str));
format(str, sizeof(str), "LHTmem/%s", str);
new INI:lol = INI_Open(str);
INI_WriteInt(lol, "RandomName", 1337);
INI_Close(lol);
SetPVarInt(player1, "LHT:IsMember", 1);
GetPlayerName(player1, str, sizeof(str));
format(str, sizeof(str), "\"%s\" is now a member of LHT!!! {ffff00}Congratulations!!!!!", str);
for(new i; i < MAX_PLAYERS; i++) SendClientMessage(i, red, str);
} else return SendClientMessage(playerid, red, "ERROR: Player is not connected!");
} else SendClientMessage(playerid, red, "ERROR: You are not a high enough level to use this command");
return 1;
}
SO ITS LIKE
pawn Код:
COMMAND:kick(playerid, params[])
{
new PlayerToKick, Reason[128], ReasonMsg[128], Name[24], string[256], AdminName[24];
// Check if the player has logged in
if (APlayerData[playerid][LoggedIn] == true)
{
// Check if the player's admin-level is at least 1
if (APlayerData[playerid][PlayerLevel] >= 1)
{
if (sscanf(params, "us[128]", PlayerToKick, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/kick <PlayerToKick> <Reason>\"");
else
if (IsPlayerConnected(PlayerToKick)) // If the player is a valid playerid (he's connected)
{
// Get the name of the player who warned the player
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(playerid, AdminName, sizeof(AdminName));
// Send the warned player a message who kicked him and why he's been kicked
format(ReasonMsg, 128, "You have been kicked by %s %s", AdminLevelName[APlayerData[playerid][PlayerLevel]], Name);
SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
format(ReasonMsg, 128, "Reason: %s", Reason);
SendClientMessage(PlayerToKick, 0xFF0000FF, ReasonMsg);
format(string, 256, "{ffff00}Player {ff0000}%s{ffff00} Has Been Kicked By {FF0000}%s {ffff00}[Reason: {FF0000}%s]", Name, AdminName, Reason);
SendClientMessageToAll(0xff00FF,string);
// Kick the player
Kick(PlayerToKick);
}
else
SendClientMessage(playerid, 0xFF0000FF, "That player isn't online");
}
else
return 0;
}
else
return 0;
// Let the server know that this was a valid command
return 1;
}
Re: How to change this to zcmd -
antonio112 - 20.03.2012
pawn Код:
CMD:makelht(playerid, params[])
{
if(PlayerInfo[playerid][Level] >= 5)
{
new pID, str[128], pName[MAX_PLAYER_NAME];
if (sscanf(params, "u", pID))
return SendClientMessage(playerid, 0xFF0000AA, "Usage: makelht <Player ID>");
GetPlayerName(pID, pName, MAX_PLAYER_NAME);
format(str, sizeof str, "LHTmem/%s", pName);
new INI:lol = INI_Open(str);
INI_WriteInt(lol, "RandomName", 1337);
INI_Close(lol);
SetPVarInt(pID, "LHT:IsMember", 1);
format(str, sizeof str, "\"%s\" is now a member of LHT!!! {ffff00}Congratulations!!!!!", pName);
for(new i; i < MAX_PLAYERS; i++) SendClientMessage(i, red, str);
} else SendClientMessage(playerid, red, "ERROR: You are not a high enough level to use this command");
return 1;
}