SA-MP Forums Archive
Mysql help - 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: Mysql help - Rep+ (/showthread.php?tid=571950)



Mysql help - Rep+ - OscarJohnson - 23.04.2015

Hello, How I can set everyone to PVIP if they had Diamond VIP only



Sorry for my bad english


Re: Mysql help - Rep+ - AberKane - 23.04.2015

First you need to know the number of each VIP type.
Код:
vipType[playerid];
or if you have an enum for your player infos...
Код:
enum PlayerInfos {
    vipType,
}
Then to save it to your MySQL database.
This is an exemple query...
Код:
new query[50];
format(query, sizeof(query), "UPDATE accounts SET vipType =  '%d' WHERE pID = '%d'", vipType[playerid], pID);
//Send the query
pID is just a place holder, there should be placed your real player ID of the database, the one you want updated.

To give a vip level for a player.
Код:
vipType[playerid] = 1;//Bronze VIP