SA-MP Forums Archive
sscanf problem. - 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: sscanf problem. (/showthread.php?tid=368681)



sscanf problem. - TaLhA XIV - 14.08.2012

PHP код:
#include <sscanf2> 
PHP код:
C:\Users\TaLhA XIV\Desktop\Pawno scripter\filterscripts\housesystem.pwn(115) : error 017undefined symbol "params" 
PHP код:
if(sscanf(params,"i",HousePrice)) return SendClientMessage(playerid,-1,"USAGE: /createhouse <price>"); 
Please help.


Re: sscanf problem. - IceMeteor - 14.08.2012

Show all of the CMD dude


Re: sscanf problem. - TaLhA XIV - 14.08.2012

PHP код:
public OnPlayerCommandText(playeridcmdtext[])
{
    if (
strcmp("/createhouse"cmdtexttrue10) == 0)
    {
        if(
IsPlayerAdmin(playerid))
        {
            new 
Float:x,Float:y,Float:z;
            new 
HousePrice,id HouseCount;
            
GetPlayerPos(playerid,x,y,z);
            if(
sscanf(params,"i",HousePrice)) return SendClientMessage(playerid,-1,"USAGE: /createhouse <price>");
            
HInfo[id][Price] = HousePrice;
            
HInfo[id][XPos] = x;
            
HInfo[id][YPos] = y;
            
HInfo[id][ZPos] = z;
            
HInfo[id][VirtualWorld] = GetPlayerVirtualWorld(playerid);
            
CreatePickup(1278,1,HInfo[id][XPos],HInfo[id][YPos],HInfo[id][ZPos],-1);
        }
        return 
1;
    } 



Re: sscanf problem. - lamarr007 - 14.08.2012

You must use ZCMD, or DCMD or Y_CMD


Re: sscanf problem. - ryansheilds - 14.08.2012

Just change 'params' to 'cmdtext'.


Re: sscanf problem. - CROSS_Hunter - 14.08.2012

it says OnPlayerCommandText(playerid, cmdtext[]) not OnplayerCommandText(playerid, params[]) so change from params to cmdtext or simply use dcmd or other methods of commands


Re: sscanf problem. - Cxnnor - 14.08.2012

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if (strcmp("/createhouse", cmdtext, true, 10) == 0)
    {
        if(IsPlayerAdmin(playerid))
        {
            new Float:x,Float:y,Float:z;
            new HousePrice,id = HouseCount;
            GetPlayerPos(playerid,x,y,z);
            if(sscanf(cmdtext,"i",HousePrice)) return SendClientMessage(playerid,-1,"USAGE: /createhouse <price>");
            HInfo[id][Price] = HousePrice;
            HInfo[id][XPos] = x;
            HInfo[id][YPos] = y;
            HInfo[id][ZPos] = z;
            HInfo[id][VirtualWorld] = GetPlayerVirtualWorld(playerid);
            CreatePickup(1278,1,HInfo[id][XPos],HInfo[id][YPos],HInfo[id][ZPos],-1);
        }
        return 1;
    }



Re: sscanf problem. - JaKe Elite - 14.08.2012

change the params on sscanf to cmdtext.


Re: sscanf problem. - [MM]RoXoR[FS] - 14.08.2012

Use cmdtext instead of params.