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



Country - BetaLaxx - 16.12.2011

Okay so after a little tutorial, on the registration step, the server asks players country, and he types his country name in input box which will get saved, But the problem i found is it actually doesn't show anything in /stats + in .ini file. It shows "Country = " That's It, My Code Below, Help Me If You Can.
pawn Код:
format(PlayerInfo[playerid][pCountry], 128, "%s", strval(inputtext));



Re: Country - BetaLaxx - 16.12.2011

Got Another Bug Right Now

((Whats your name in west coast?))


Re: Country - BetaLaxx - 16.12.2011

pawn Код:
C:\Alex\County Wars TDM 0.3d\gamemodes\SCRP.pwn(2737) : error 033: array must be indexed (variable "country")
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
I See.


Re: Country - XFlawless - 16.12.2011

Quote:
Originally Posted by belhot1992
Посмотреть сообщение
Try doing it this way:

pawn Код:
new country[128];
country = strval(inputtext);
format(PlayerInfo[playerid][pCountry], 128, "%s", country);
Don't know if it will work though..
I guess you're saving country as a string, but I don't know
Tell me what happened.
Isn't strval() used to convert string to integer ?


Re: Country - BetaLaxx - 16.12.2011

pawn Код:
C:\Alex\County Wars TDM 0.3d\gamemodes\SCRP.pwn(2736) : error 008: must be a constant expression; assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Lol.


Re: Country - BetaLaxx - 16.12.2011

Well, I Gotta Go For Sleep Now.
Thanks for the help, See ya Tomorrow West Rider.
You're a helpful friend, Add me at MSN if you ever need help.
amz-dm@hotmail.com


Re: Country - [ABK]Antonio - 16.12.2011

Quote:
Originally Posted by BetaLaxx
Посмотреть сообщение
Okay so after a little tutorial, on the registration step, the server asks players country, and he types his country name in input box which will get saved, But the problem i found is it actually doesn't show anything in /stats + in .ini file. It shows "Country = " That's It, My Code Below, Help Me If You Can.
pawn Код:
format(PlayerInfo[playerid][pCountry], 128, "%s", strval(inputtext));
pawn Код:
new MyString = inputtext[0];
SomeVar = MyString;
I'm not sure if that would work for what you're doing, could always give it a shot though lol - untested


Re: Country - [ABK]Antonio - 16.12.2011

or do above ^


Re: Country - Oh - 16.12.2011

Basic /stats command.

pawn Код:
forward Stats(playerid)
pawn Код:
if(strcmp(cmd,"/stats",true)==0)
        {
            if(IsPlayerConnected(playerid))
            {
                Stats(playerid,playerid);
            }
            return 1;
        }


pawn Код:
public Stats(playerid)
    {
        if(IsPlayerConnected(playerid))
        {
            new country[128];
            if(PlayerInfo[playerid][pCountry] == 1) { country = "Whatever"; }
            else if(PlayerInfo[playerid][pCountry] == 2) { country = "Whatever else here"; }
            new coordsstring[256];
            format(coordsstring, sizeof(coordsstring),"\\ Stats //",);
            SendClientMessage(playerid, COLOR,coordsstring);
            format(coordsstring, sizeof(coordsstring), " Country: [%s]", country);
            SendClientMessage(playerid, COLOR,coordsstring);
        }
       
    }



Re: Country - BetaLaxx - 16.12.2011

Not Asking /Stats Command.
Force On The Post.

And:
pawn Код:
C:\Alex\County Wars TDM 0.3d\gamemodes\SCRP.pwn(2737) : warning 204: symbol is assigned a value that is never used: "country"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.