params.
#1

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"cmdtexttrue10) == 0)
       {
    if(!
strlen(params)) return
    
SendClientMessage(playeridORANGE"Usage: /pm [PlayerID]");
    
PMplayer1 strval(params);
    if(
PMplayer1 == playerid) return
    
SendClientMessage(playeridORANGE"ERROR: You can't send PM to yourself!");
    if(!(
IsPlayerConnected(PMplayer1) && PMplayer1 != INVALID_PLAYER_ID)) return
    
SendClientMessage(playeridORANGE"ERROR: Player not Connected!");
    new 
string[128];
    
GetPlayerName(PMplayer1PmReceiversizeof(PmReceiver));
    
format(string,sizeof(string),"PM To: \"%s(%d)\" \n\nType the message to send:"PmReceiverPMplayer1);
    
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 017undefined symbol "params"
C:\Users\MaticKepa\Desktop\DM FROM START\gamemodes\zFreePlay.pwn(684) : error 017undefined symbol "params"
Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
2 Errors

Reply
#2

dump
Reply
#3

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

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

Params only are found with other command processors such as DCMD, ZCMD,YCMD etc..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)