new name[MAX_PLAYER_NAME],file[80];GetPlayerName(playerid, name, sizeof(name));format(file,sizeof(file),"%s.txt",name);
INI_ParseFile(file, "PlayerStatusClass", false, true, playerid, true, false );
new ClassInfo[20]; GetPVarString(playerid, "SoldierInfo", ClassInfo, sizeof ClassInfo);
if(!strcmp("Soldier",ClassInfo,true))
{
ShowPlayerDialog(playerid,WeaponShop ,DIALOG_STYLE_MSGBOX,"bla bla","|Soldier|","Buy","Cancel");
new string[128]; format(string,sizeof(string),"levelNow: %d",ClassInfo); //i got this so i can see if the player is a Soldier.
SendClientMessage(playerid,YELLOW,string);// But it allways Prints [levelNow: 0] :(
}
else
{
ShowPlayerDialog(playerid,WeaponShop ,DIALOG_STYLE_MSGBOX,"bla bal",""xRED"Nothing Found","Buy","Cancel");
}
yes of course D they go into OnPlayerPickUpPickup
and i forgot to add something when the player Enters The pickup and he is not a Soldier the Dialog Will still show for him |
Default Problem :|
im trying to make a dialog only for a Soldier but it doesnt work
the code
pawn Code:
forward PlayerStatusClass(playerid, name[], value[]);
public PlayerStatusClass(playerid, name[], value[])
{
if(!strcmp(name, "SoldierInfo"))SetPVarInt(playerid,"SoldierInfo", strval(value ));
}
//later On in the script under OnPlayerPickUpPickup and yes i do have the pickup id and everything
new name[MAX_PLAYER_NAME],file[80];GetPlayerName(playerid, name, sizeof(name));format(file,sizeof(file),"%s.txt",name);
INI_ParseFile(file, "PlayerStatusClass", false, true, playerid, true, false );
new ClassInfo[20]; GetPVarString(playerid, "SoldierInfo", ClassInfo, sizeof ClassInfo);
if(strcmp("Soldier",ClassInfo,true))
{
ShowPlayerDialog(playerid,WeaponShop ,DIALOG_STYLE_MSGBOX,"bla bla","|Soldier|","Buy","Cancel");
new string[128]; format(string,sizeof(string),"levelNow: %d",ClassInfo); //i got this so i can see if the player is a Soldier.
SendClientMessage(playerid,YELLOW,string);// But it allways Prints [levelNow: 0] :(
}
else
{
ShowPlayerDialog(playerid,WeaponShop ,DIALOG_STYLE_MSGBOX,"bla bal",""xRED"Nothing Found","Buy","Cancel");
}
if(!strcmp("Soldier",ClassInfo,true)) |
I am not sure but I think this is your mistake:
PHP код:
This was your mistake: |
if(!strcmp(name, "SoldierInfo"))SetPVarInt(playerid,"SoldierInfo", strval(value ));
if(!strcmp(name, "SoldierInfo")) SetPVarString(playerid, "SoldierClassInfo", value);
no that was not the problem P;
this was the problem pawn Код:
pawn Код:
|