SA-MP Forums Archive
Ayuda con este comando - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Ayuda con este comando (/showthread.php?tid=537666)



Ayuda con este comando - FlavioCesar - 17.09.2014

Buenas... Tengo este comando para hacer slap's:

Quote:

dcmd_slap(playerid, params[])
{
new id, string[126], Float: PPos[3];
if(sscanf(params, "u", id))
return SendClientMessage(playerid, -1, "USO: /slap [id]");

GetPlayerPos(id, PPos[0], PPos[1], PPos[2]);
SetPlayerPos(id, PPos[0], PPos[1], PPos[2]+4);

format(string, sizeof(string), "* SLAP COMPLETO" );
SendClientMessage(playerid, -1, string);
return 1;
}

Compila bien, pero quiero que donde manda el mensaje "* SLAP COMPLETO" ponga: "* Has hecho un slap a [PLAYERNAME]"

Entonces hice esto:

Quote:

dcmd_slap(playerid, params[])
{
new pName[24];
GetPlayerName(playerid, pName, 24);

new id, string[126], Float: PPos[3];
if(sscanf(params, "u", id))
return SendClientMessage(playerid, -1, "USO: /slap [id]");

GetPlayerPos(id, PPos[0], PPos[1], PPos[2]);
SetPlayerPos(id, PPos[0], PPos[1], PPos[2]+4);

format(string, sizeof(string), "* Has hecho un slap a %s" pName );
SendClientMessage(playerid, -1, string);
return 1;
}

Pero entonces al compilar me pone 4 errores:

Quote:

( 5 3 9 8 ) : error 001: expected token: "-string end-", but found "-identifier-"
( 5 3 9 8 ) : warning 215: expression has no effect
( 5 3 9 8 ) : error 001: expected token: ";", but found ")"
( 5 3 9 8 ) : error 029: invalid expression, assumed zero
( 5 3 9 8 ) : fatal error 107: too many error messages on one line

La linea 5398 es donde va el mensaje con el " pName "

Ayuda por favor


Respuesta: Ayuda con este comando - Zume - 17.09.2014

sуlo te faltу una coma xD

pawn Код:
dcmd_slap(playerid, params[])
{
new pName[24];
GetPlayerName(playerid, pName, 24);

new id, string[126], Float: PPos[3];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USO: /slap [id]");

GetPlayerPos(id, PPos[0], PPos[1], PPos[2]);
SetPlayerPos(id, PPos[0], PPos[1], PPos[2]+4);

format(string, sizeof(string), "* Has hecho un slap a %s", pName);
SendClientMessage(playerid, -1, string);
return 1;
}



Re: Respuesta: Ayuda con este comando - FlavioCesar - 17.09.2014

Quote:
Originally Posted by Zume-Zero
Посмотреть сообщение
sуlo te faltу una coma xD

pawn Код:
dcmd_slap(playerid, params[])
{
new pName[24];
GetPlayerName(playerid, pName, 24);

new id, string[126], Float: PPos[3];
if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USO: /slap [id]");

GetPlayerPos(id, PPos[0], PPos[1], PPos[2]);
SetPlayerPos(id, PPos[0], PPos[1], PPos[2]+4);

format(string, sizeof(string), "* Has hecho un slap a %s", pName);
SendClientMessage(playerid, -1, string);
return 1;
}
Muchнsimas graciasss!