SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 17/05/2019, 02:44 PM   #1
keJo
Little Clucker
 
Join Date: Mar 2019
Posts: 9
Reputation: 2
Default need help please

Hello guys im using y_ini and vip saving system!!, the porblem is when a player join my server he got vip level automatically without permission this happen sometimes help me kindly!!

Last edited by keJo; 18/05/2019 at 08:08 AM.
keJo is offline   Reply With Quote
Old 17/05/2019, 02:49 PM   #2
Proxus
Big Clucker
 
Proxus's Avatar
 
Join Date: May 2018
Location: United Kingdom
Posts: 156
Reputation: 4
Default Re: need urgent help please

It'd be helpful if you posted code snippets from some useful parts of your code. For example, from the OnPlayerConnect function.
__________________
Developer @ Trucknation
"Never tell people how to do things. Tell them what to do and they will surprise you with their ingenuity"
Proxus is offline   Reply With Quote
Old 18/05/2019, 06:01 AM   #3
dwp12345
Little Clucker
 
Join Date: Feb 2016
Location: Denmark
Posts: 14
Reputation: 1
Default Re: need urgent help please

Code:
public OnPlayerConnected(playerid)
{
      PlayerInfo[playerid][VIP] = 0; // RESET ALL STATUS WHEN PLAYER CONNECTED, CHANGE TO YOUR OWN CODE ITS JUST EXAMPLE.
      // LOGIN DIALOG // STATUS WILL RESTORED AFTER PLAYER LOGIN
      return 1;
}
__________________
everything gonna be fine.
dwp12345 is offline   Reply With Quote
Old 18/05/2019, 08:05 AM   #4
keJo
Little Clucker
 
Join Date: Mar 2019
Posts: 9
Reputation: 2
Default Re: need urgent help please

Quote:
Originally Posted by Proxus View Post
It'd be helpful if you posted code snippets from some useful parts of your code. For example, from the OnPlayerConnect function.
CMD:makevip(playerid, params[])
{
new victimname[MAX_PLAYER_NAME], playername[64], vipname[MAX_PLAYER_NAME], viplevel, giveplayerid, string[128];
if(IsPlayerAdmin(playerid))
{
if(PlayerInfo[playerid][pVipLevel] == 1) { vrank = "Bronze VIP"; }
else if(PlayerInfo[playerid][pVipLevel] == 2) { vrank = "Silver VIP"; }
else if(PlayerInfo[playerid][pVipLevel] == 3) { vrank = "Gold VIP"; }
if(sscanf(params, "ui", giveplayerid, viplevel)) return SendClientMessage(playerid, COLOR_WHITE, "[USAGE]: /makevip [playerid] [level]");
if(giveplayerid == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFF0000AA, "Player is not connected.");
if(viplevel > 3 || viplevel < 0) return SendClientMessage(playerid, 0xFF0000AA, "Valid levels: 1-3");
PlayerInfo[giveplayerid][pVipLevel] = viplevel;
new playername[64];
GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
GetPlayerName(giveplayerid, victimname, sizeof(victimname));
GetPlayerName(playerid, vipname, sizeof(vipname));
format(string,sizeof(string),"[SYSTEM]"LOW" Admin %s has set your VIP level to %i"RED" |-",playername, viplevel);
SendClientMessage(giveplayerid,COLOR_RED , string);
format(string, sizeof(string), "[SYSTEM]: You set %s VIP level to %i.", victimname, viplevel, giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
else return SendClientMessage(playerid, 0xFF0000AA, "You are not RCON admin.");
}
keJo is offline   Reply With Quote
Old 20/05/2019, 01:57 AM   #5
keJo
Little Clucker
 
Join Date: Mar 2019
Posts: 9
Reputation: 2
Default Re: need help please

anyone help please ?
keJo is offline   Reply With Quote
Old 20/05/2019, 02:33 AM   #6
Plastikmensch
Big Clucker
 
Join Date: Aug 2016
Posts: 171
Reputation: 8
Default Re: need help please

The makevip command is not related to your issue as you stated.
Are you resetting the variables at OnPlayerDisconnect to 0?
Plastikmensch is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:57 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.