Age problem
#1

Hello,i wanted to make an command with u can see your age,but i failed,it wont show it it will be there like age: but wont show the number...

Heres the command:

Quote:

if(strcmp(cmd,"/age,true)==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pTest] = 1)
{
new targetid = Spectate[playerid];
new text2[20];
new text3[20];
new text4[20];
new text5[20];
new otaxt[20];
new sextext[20];
new sendername[MAX_PLAYER_NAME];
new sage = PlayerInfo[playerid][pAge]
new agetext = PlayerInfo[targetid][pAge];
format(string, sizeof(string), "** Age: %s", agetext);
SendClientMessage(playerid, COLOR_GREY, string);
SendClientMessage(playerid, COLOR_WHITE, "|______________________________________________|" );
}
else
{
SendClientMessage(playerid, COLOR_RED, "You havent done the Test yet!");
}
return 1;
}
}

Reply
#2

BUMP!kinda need help with this hurry :S thx
Reply
#3

pawn Код:
format(string, sizeof(string), "** Age: %s", agetext);
might be

pawn Код:
format(string, sizeof(string), "** Age: %i", agetext);
Difference:
Код:
%s - string
%i,%d - integer
Reply
#4

Quote:
Originally Posted by Щә яә Ґя
Difference:
Код:
%s - string
%i,%d - integer
didnt know it:S but now its shows 0 only,but my pAge is 20
Reply
#5

because 'agetext' is a string you should use this line instead
pawn Код:
format(string,sizeof(string),"Age: %d",PlayerInfo[targetid][pAge]);
Reply
#6

aww still it shows 0
Reply
#7

Then 'PlayerInfo[targetid][pAge]' is 0, make sure that it's being set to a number somewhere in your script. You're not typing this while not logged in are you?
Reply
#8

oooh im not so dumb,btw its at my user file


Key=0wqrqw4m321g321
Level=1
AdminLevel=15
DonateRank=0
UpgradePoints=0
ConnectedTime=0
Registered=1
Sex=1
Age=20
Origin=4
CK=0
Muted=0
Respect=0
Money=2495
Bank=0
Crimes=0
Kills=0
Deaths=0
Arrested=0
WantedDeaths=0
Phonebook=0
LottoNr=0
Fishes=0
BiggestFish=0
Job=0
Paycheck=3029
HeadValue=0
Jailed=0
JailTime=0
Materials=0
Drugs=0
Leader=0
Member=0
FMember=255
Rank=0
Char=113
ContractTime=0
DetSkill=0
SexSkill=0
BoxSkill=0
LawSkill=0
MechSkill=0
JackSkill=0
CarSkill=0
NewsSkill=0
DrugsSkill=0
CookSkill=0
FishSkill=0
pSHealth=0.0
pHealth=50.0
Int=0
Local=255
Team=3
Model=135
PhoneNr=647500
Car=999
Car2=999
Car3=999
House=255
Bizz=255
Pos_x=1552.3
Pos_y=-2337.7
Pos_z=13.5
CarLic=0
FlyLic=0
Passport=1
BoatLic=0
FishLic=0
GunLic=0
Gun1=0
Gun2=0
Gun3=0
Gun4=0
Ammo1=0
Ammo2=0
Ammo3=0
Ammo4=0
CarTime=0
PayDay=5
PayDayHad=0
Watch=0
Crashed=0
Wins=0
Loses=0
AlcoholPerk=0
DrugPerk=0
MiserPerk=0
PainPerk=0
TraderPerk=0
Tutorial=1
Mission=0
Warnings=0
VirWorld=0
Fuel=0
Married=0
MarriedTo=No-one
FishTool=0
Note1=None
Note1s=0
Note2=None
Note2s=0
Note3=None
Note3s=0
Note4=None
Note4s=0
Note5=None
Note5s=0
InvWeapon=0
InvAmmo=0
Lighter=0
Cigarettes=0
Locked=0
Reply
#9

That doesn't mean it's not being set to something in your script. There could be a 'resetvariables' like function in your script that's setting a player's ago to 0, then it loads your information, and just skips age.
Reply
#10

i searched for "resetvariables" but nothing..:S
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)