Ayuda con este comando
#1

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
Reply
#2

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;
}
Reply
#3

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)