params. - 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: params. (
/showthread.php?tid=364509)
params. -
kepa333 - 30.07.2012
heloo i got /pm script and i need to fix it but idk nothing about params.. can any 1 help me?
PHP код:
if (strcmp("/pm", cmdtext, true, 10) == 0)
{
if(!strlen(params)) return
SendClientMessage(playerid, ORANGE, "Usage: /pm [PlayerID]");
PMplayer1 = strval(params);
if(PMplayer1 == playerid) return
SendClientMessage(playerid, ORANGE, "ERROR: You can't send PM to yourself!");
if(!(IsPlayerConnected(PMplayer1) && PMplayer1 != INVALID_PLAYER_ID)) return
SendClientMessage(playerid, ORANGE, "ERROR: Player not Connected!");
new string[128];
GetPlayerName(PMplayer1, PmReceiver, sizeof(PmReceiver));
format(string,sizeof(string),"PM To: \"%s(%d)\" \n\nType the message to send:", PmReceiver, PMplayer1);
ShowPlayerDialog(playerid,DIALOG_TYPE_PM,DIALOG_STYLE_INPUT,"PrivateMessage",string,"Send!","Cancel");
return 1;
}
return 0;
}
PHP код:
C:\Users\MaticKepa\Desktop\DM FROM START\gamemodes\zFreePlay.pwn(682) : error 017: undefined symbol "params"
C:\Users\MaticKepa\Desktop\DM FROM START\gamemodes\zFreePlay.pwn(684) : error 017: undefined symbol "params"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
Re: params. -
kepa333 - 31.07.2012
dump
Re: params. -
ReneG - 31.07.2012
params is used in zcmd.
pawn Код:
CMD:command(playerid, params[]) // you see?
{
return 1;
}
not in OnPlayerCommandText
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[]) // params isn't here.
{
return 1;
}
Re: params. -
KappaCro - 31.07.2012
Try this:
pawn Код:
if (strcmp("/pm", cmdtext, true, 10) == 0)
{
if(!strlen(cmdtext)) return
SendClientMessage(playerid, ORANGE, "Usage: /pm [PlayerID]");
PMplayer1 = strval(cmdtext);
if(PMplayer1 == playerid) return
SendClientMessage(playerid, ORANGE, "ERROR: You can't send PM to yourself!");
if(!(IsPlayerConnected(PMplayer1) && PMplayer1 != INVALID_PLAYER_ID)) return
SendClientMessage(playerid, ORANGE, "ERROR: Player not Connected!");
{
new string[128];
GetPlayerName(PMplayer1, PmReceiver, sizeof(PmReceiver));
format(string,sizeof(string),"PM To: \"%s(%d)\" \n\nType the message to send:", PmReceiver, PMplayer1);
ShowPlayerDialog(playerid,DIALOG_TYPE_PM,DIALOG_STYLE_INPUT,"PrivateMessage",string,"Send!","Cancel");
return 1;
}
return 0;
}
Re: params. -
phillip875 - 31.07.2012
Params only are found with other command processors such as DCMD, ZCMD,YCMD etc..