Ajuda em 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: Ajuda em ZCMD (
/showthread.php?tid=305600)
Ajuda em ZCMD -
cezaro - 23.12.2011
iae galera й o seguinte to com um problema no if(!IsPlayerConnected(idx)) eu do o tapa ex: /tapa 20 mas o id 20 nao esta conectado e o tapa vai em min nao aparece a mensagem ali "Jogador off-line" alguem poderia me ajudar?
desde ja obrigado
CMD:tapa(playerid,params[])
{
if(info[playerid][pAdmin] >= 1)
{
new
idx,
Float:c[3]
;
if(sscanf(params,"u",idx)) return SendClientMessage(playerid,verde,"use /tapa [id]");
if(!IsPlayerConnected(idx)) return SendClientMessage(playerid,-1,"Jogador off-line");
GetPlayerPos(idx,c[0],c[1],c[2]);
SetPlayerPos(idx,c[0],c[1],c[2]+25);
SendClientMessage(playerid,verde,"tapa dado com sucesso.");
}
else return SendClientMessage(playerid,fail,NAOADM);
return 1;
}
Respuesta: Ajuda em ZCMD -
[Nikk] - 23.12.2011
Post here:
http://forum.sa-mp.com/forumdisplay.php?f=34
Re: Ajuda em ZCMD -
[ABK]Antonio - 23.12.2011
pawn Код:
CMD:slap(playerid, params[])
{
new idx;
if(sscanf(params, "u", idx)) return SendClientMessage(playerid, 0xFF0000AA, "USAGE: /slap <playerid/partofname>"); //Send an error message to the one who didn't type the correct params
if(info[playerid][pAdmin] >= 1) //Replace this with your administrator variable
{
if(IsPlayerConnected(idx))
{
new Float:x, Float:y, Float:z, name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME]; //create the variables we will use later
GetPlayerName(playerid, name, sizeof(name)); //Get the name of the one that slapped
GetPlayerName(idx, name2, sizeof(name2));//Get the name of the one that was slapped
format(str,sizeof(str), "You have slapped %s[%d]!",idx, name2); //Format the message we send to the slapper
SendClientMessage(playerid, 0xFF0000AA, str);//Send the message
format(str,sizeof(str), "%s[%d] has slapped you!",playerid, name); //Format the message we send to the slappee
SendClientMessage(idx, 0xFF0000AA, str); //Send the message
GetPlayerPos(idx, x,y,z); //Get the players position storing it into the vars we created earlier
SetPlayerPos(idx, x,y,z+5); //Set their Z axis position to +5 their current
}
else return SendClientMessage(playerid, 0xFF0000AA, "Invalid player!"); //Error message if the player isn't connected
}
else return SendClientMessage(playerid, 0xFF0000AA, "You don't have the required level to access this command."); //Error message if their level isn't high enough
return 1;
}
Is this what you mean?