Player info problem -
Pawnie - 03.11.2013
How do I use ex:
Код:
if(PlayerInfo[playerid][pArrested] == "Yes")
I got now
Код:
if(PlayerInfo[playerid][pArrested] == 1)
I want to change it yes no. Pleas!
Re: Player info problem -
Ghazal - 03.11.2013
Do You Mean Yes No In Army / Cia ?
Here Is A Stock
Код:
stock YesNo(playerid)
{
new string[5];
switch(CanUseCIA[playerid])
{
case 0: string = "No";
case 1: string = "Yes";
}
return string;
}
+ Rep If Helped.
Re: Player info problem -
Daddy Yankee - 03.11.2013
Код:
if(strcmp(PlayerInfo[playerid][pArrested],"Yes",true) == 0)
You also need to change the way you load/save it, from integer to string. Can't help you there since I don't have know your code.
Re: Player info problem -
AlonzoTorres - 03.11.2013
Make pArrested a string with the length of four, pArrested[4] (Yes + \0), then when you want to add Yes or No to someone you do the following:
pawn Код:
strcat((PlayerInfo[playerid][pArrested][0] = EOS, PlayerInfo[playerid][pArrested]), "Yes", 4);
Or:
pawn Код:
strcat((PlayerInfo[playerid][pArrested][0] = EOS, PlayerInfo[playerid][pArrested]), "No", 4);
Then just:
pawn Код:
if(!strcmp(PlayerInfo[playerid][pArrested], "Yes")){
...
}
Re: Player info problem -
Pawnie - 03.11.2013
Quote:
Originally Posted by Daddy Yankee
Код:
if(strcmp(PlayerInfo[playerid][pArrested],"Yes",true) == 0)
You also need to change the way you load/save it, from integer to string. Can't help you there since I don't have know your code.
|
Well I am using simple enum for these
Код:
enum PlayerInfo
{
pArrested,
pPrisoned
}
new pInfo[MAX_PLAYERS][PlayerInfo];
CMD:out(playerid,params[])
{
if(PlayerInfo[playerid][pArrested] == "Yes")
{
SetPlayerPos(playerid,1312.00,1254.122,744.00);
}
else SendClientMessage(playerid, COLOR_RED, "You are not even prisoned");
}
Re: Player info problem -
AlonzoTorres - 03.11.2013
Quote:
Originally Posted by Pawnie
Well I am using simple enum for these
Код:
enum PlayerInfo
{
pArrested,
pPrisoned
}
new pInfo[MAX_PLAYERS][PlayerInfo];
CMD:out(playerid,params[])
{
if(PlayerInfo[playerid][pArrested] == "Yes")
{
SetPlayerPos(playerid,1312.00,1254.122,744.00);
}
else SendClientMessage(playerid, COLOR_RED, "You are not even prisoned");
}
|
See my solution, it is complete and works with your system.
Re: Player info problem -
Pawnie - 03.11.2013
but I got lots of places using the pArrested, do I need to place it inside every single function or? I mean where do I place your code at
Re: Player info problem -
Pawnie - 06.11.2013
Can anyone help?
I need to define it somehow otherwise. Like in my enum
Quote:
if(strcmp(PlayerInfo[playerid][pArrested],"Yes",true) == 0)
|
Re: Player info problem -
Djole1337 - 06.11.2013
Quote:
Originally Posted by Maro06
Do You Mean Yes No In Army / Cia ?
Here Is A Stock
Код:
stock YesNo(playerid)
{
new string[5];
switch(CanUseCIA[playerid])
{
case 0: string = "No";
case 1: string = "Yes";
}
return string;
}
|
pawn Код:
stock YesNo(playerid)
{
string = (CanUseCIA[playerid] == 0) ? ("No") : ("Yes");
return string;
}
ok
Re: Player info problem -
Pawnie - 10.11.2013
Is there any way to do it without stock? Like to be in the enum? Like I got so far. Like
PlayerInfo[playerid][pBanned] = "account";
and to be able to do also
PlayerInfo[playerid][pBanned] = "IP";