Need help with this please. +Rep - 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: Need help with this please. +Rep (
/showthread.php?tid=324097)
Need help with this please. +Rep -
rangerxxll - 08.03.2012
Hello,
I'm having a problem with this. I want it, so if a player is already level 1, 2, 3, or 4 VIP they can't use this. Here's my current code.
pawn Код:
if(dialogid == 255 && response)
{
switch(listitem)
{
case 0:
{
if(PlayerInfo[playerid][pCookies] >= 5)
{
PlayerInfo[playerid][pVip] = 4;
if(PlayerInfo[playerid][pVip] >= 4)
{
SetTimerEx("TempVip", 150000, false, "i", playerid);
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
new MyString[128];
PlayerInfo[playerid][pCookies] = PlayerInfo[playerid][pCookies] - 5;
format(MyString,sizeof MyString, "You are now temporary VIP Level 3 for 15 minutes.");
SendClientMessage(playerid, COLOR_GREEN, MyString);
}
else SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You're already a VIP member.");
}
else SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You don't have enough cookies. You need 5. You can check your cookies with /mycookies.");
}
}
}
return 1;
}
I've tried editing
pawn Код:
if(PlayerInfo[playerid][pVip]
Multiple times. It's just not working out. I've been trying for about a hour. So now I thought was time to come here.
Any help is appreciated, thanks.
Re: Need help with this please. +Rep -
Sufyan - 08.03.2012
show me Command code..
Edit:
Код:
if(PlayerInfo[playerid][pVip] > 4) try this
Re: Need help with this please. +Rep -
rangerxxll - 08.03.2012
Quote:
Originally Posted by Sufyan
show me Command code..
|
All the command does is show the dialog.
pawn Код:
COMMAND:cshop(playerid, params[])
{
if(PlayerInfo[playerid][pCookies]>=2)
{
ShowPlayerDialog(playerid, 255, DIALOG_STYLE_LIST, "Cookies Shop.", "Temporary VIP Package. Lasts 15 minutes. (5 Cookies)", "Accept", "Exit");
}
else SendClientMessage(playerid, COLOR_BRIGHTRED, "You need at least 2 cookies to open the Cookies Shop.");
return 1;
}
Re: Need help with this please. +Rep -
Shabi RoxX - 08.03.2012
Quote:
Originally Posted by rangerxxll
Hello,
I'm having a problem with this. I want it, so if a player is already level 1, 2, 3, or 4 VIP they can't use this. Here's my current code.
pawn Код:
if(dialogid == 255 && response) { switch(listitem) { case 0: { if(PlayerInfo[playerid][pCookies] >= 5) { Pl4; if(PlayerInfo[playerid][pVip] >= 4) { SetTimerEx("TempVip", 150000, false, "i", playerid); new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); new MyString[128]; PlayerInfo[playerid][pCookies] = PosterIori[playerid][pCookies] - 5; I format(MyString,sizeof MyString, "You are now temporary VIP Level 3 for 15 minutes."); SendClientMessage(playerid, COLOR_GREEN, MyString); } else SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You're already a VIP member."); } else SendClientMessage(playerid, COLOR_BRIGHTRED, "ERROR: You don't have enough cookies. You need 5. You can check your cookies with /mycookies."); } } } return 1; }
I've tried editing
pawn Код:
if(PlayerInfo[playerid][pVip]
Multiple times. It's just not working out. I've been trying for about a hour. So now I thought waso time to come here.
I
Any help is appreciated, thanks.
|
I think it is cuz u r setting pvip = 4 if player have cookies => 5 which make player VIP lvl 4....... But not tmp VIP.
pawn Код:
PlayerInfo[playerid][pVip] = 4;
This makes player VIP lvl 4.... Remove this liNe
Re: Need help with this please. +Rep -
arathin - 08.03.2012
Luke I fixed it get on hamachi rofl and look!