21.03.2011, 10:14
how can i create:vip lvls,vip check and vip cmds?
P.S. How i save it all in a file?
P.S. How i save it all in a file?
CMD:setvip(playerid, params[])
{
new id,vlevel,file[256];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFFFFFFAA,"SERVER: Unknown command.");
if(sscanf(params,"ui",id,vlevel)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /setvip [id] [Level 1-3]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,0xFF0000FF, "That user is not connected.");
if(vlevel > 3) return SendClientMessage(playerid,0xFF0000FF,"AVAILABLE VIP LEVELS 1-3!");
if(vlevel == 0)
{
if(PlayerData[id][vip] == 0) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 0 vip!");
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
format(String, sizeof(String),"%s has set your VIP Level to 0!",Name);
SendClientMessage(id,0xFF9900AA,String);
format(String,sizeof(String),"You had set %s VIP Level to 0!",pname);
SendClientMessage(playerid,0xFF9900AA,String);
dini_IntSet(file,"VIP", 0);
PlayerData[id][vip] = 0;
PlayerData[playerid][vip] = 0;
PlayerData[id][vip] = 0;
}
if(vlevel == 1)
{
if(PlayerData[id][vip] == 1) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 1 vip!");
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
format(String, sizeof(String),"%s has set your VIP Level to 1 (BRONZE VIP)!",Name);
SendClientMessage(id,0xFF9900AA,String);
format(String, sizeof(String),"You had set %s VIP Level to 1 (BRONZE VIP)!",pname);
SendClientMessage(playerid,0xFF9900AA,String);
dini_IntSet(file,"VIP", 1);
PlayerData[id][vip] = 1;
PlayerData[playerid][vip] = 1;
PlayerData[id][vip] = 1;
}
if(vlevel == 2)
{
if(PlayerData[id][vip] == 2) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 2 vip!");
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
format(String, sizeof(String),"%s has set your VIP Level to 2 (SILVER VIP)!",Name);
SendClientMessage(id,0xFF9900AA,String);
format(String, sizeof(String),"You had set %s VIP Level to 2 (SILVER VIP)!",pname);
SendClientMessage(playerid,0xFF9900AA,String);
dini_IntSet(file,"VIP", 2);
PlayerData[id][vip] = 2;
PlayerData[playerid][vip] = 2;
PlayerData[id][vip] = 2;
}
if(vlevel == 3)
{
if(PlayerData[id][vip] == 3) return SendClientMessage(playerid,0xFF0000FF,"ERROR: That person is already level 3 vip!");
GetPlayerName(playerid,Name,MAX_PLAYER_NAME);
GetPlayerName(playerid,pname,MAX_PLAYER_NAME);
format(String, sizeof(String),"%s has set your VIP Level to 3 (GOLD VIP)!",Name);
SendClientMessage(id,0xFF9900AA,String);
format(String, sizeof(String),"You had set %s VIP Level to 3 (GOLD VIP)!",pname);
SendClientMessage(playerid,0xFF9900AA,String);
dini_IntSet(file,"VIP", 3);
PlayerData[id][vip] = 3;
PlayerData[playerid][vip] = 3;
PlayerData[id][vip] = 3;
}
return 1;
}
CMD:ccolor(playerid, params[])
{
if(PlayerData[playerid][vip] > 0)// if it is over 0!
{
new cc1,cc2, string[256];
if(sscanf(params,"dd",cc1,cc2)) return SendClientMessage(playerid,0xFF9900AA, "USAGE: /ccolor [color1] [color2]");
ChangeVehicleColor(GetPlayerVehicleID(playerid), cc1, cc2);
format(string, sizeof(string), "You changed your first color to %d and second colour %d!", cc1, cc2);
SendClientMessage(playerid,0xFF9900AA,string);
}
else return SendClientMessage(playerid,0xFF0000FF,"ERROR: You are not an vip!");
return 1;
}
ok this is mine, dont copy mine just take an this idea and make your own
pawn Код:
|
C:\Documents and Settings\galina\щемзп дтбегд\Gta Files\filterscripts\VIP.pwn(94) : error 029: invalid expression, assumed zero C:\Documents and Settings\galina\щемзп дтбегд\Gta Files\filterscripts\VIP.pwn(94) : error 017: undefined symbol "cmd_setvip" C:\Documents and Settings\galina\щемзп дтбегд\Gta Files\filterscripts\VIP.pwn(94) : error 029: invalid expression, assumed zero C:\Documents and Settings\galina\щемзп дтбегд\Gta Files\filterscripts\VIP.pwn(94) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.