VIP -
Edin Black - 13.05.2012
Hello. I make my VIP FS. But when I type /rcon login and /setvip for another player, it happends nothing.
pawn Код:
dcmd_setvip(playerid, params[])
{
new id,vip;
if(!IsPlayerAdmin(playerid))return SendClientMessage(playerid,red,"ERROR: Nisi Admin da bi koristili ovu Komandu.");
if(sscanf(params,"ui", id,vip))return SendClientMessage(playerid, red, "KORISTI: /setvip [id] [VipID]");//VIP 1= Premium 2=Silver 3=GOLD
if(vip > 3)return SendClientMessage(playerid,red,"ERROR: Imaju samo 3 VIP Level-a.");
if(vip == 1)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "INFO: Administrator %s vam je stavio Premium VIP Level.",Name);
SendClientMessage(id,green, String);
if(!dini_Exists(PFile(playerid)))
{
dini_Create(PFile(playerid));
dini_IntSet(PFile(playerid),"VipMember",1);
}
else if(dini_Exists(PFile(playerid)))
{
dini_IntSet(PFile(playerid),"VipMember",1);
}
GivePlayerMoney(playerid, 500000);
}
if(vip == 2)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "INFO: Administrator %s vam je stavio Silver VIP Level.",Name);
SendClientMessage(id,green, String);
if(!dini_Exists(PFile(playerid)))
{
dini_Create(PFile(playerid));
dini_IntSet(PFile(playerid),"VipMember",2);
}
else if(dini_Exists(PFile(playerid)))
{
dini_IntSet(PFile(playerid),"VipMember",2);
}
GivePlayerMoney(playerid, 1000000);
}
if(vip == 3)
{
GetPlayerName(playerid, Name, sizeof(Name));
format(String, sizeof(String), "INFO: Administrator %s vam je stavio Gold VIP Level.",Name);
SendClientMessage(id,green, String);
if(!dini_Exists(PFile(playerid)))
{
dini_Create(PFile(playerid));
dini_IntSet(PFile(playerid),"VipMember",3);
}
else if(dini_Exists(PFile(playerid)))
{
dini_IntSet(PFile(playerid),"VipMember",3);
}
GivePlayerMoney(playerid, 2000000);
}
return 1;
}
Help pls..... +rep
Re: VIP -
SpiderWalk - 13.05.2012
Try to replace line
pawn Код:
if(sscanf(params,"ui", id,vip))return SendClientMessage(playerid, red, "KORISTI: /setvip [id] [VipID]");
to
pawn Код:
if(sscanf(params,"ud", id,vip))return SendClientMessage(playerid, red, "KORISTI: /setvip [id] [VipID]");
Re: VIP -
Edin Black - 13.05.2012
Nothing ...
Re: VIP -
iRage - 13.05.2012
SendClientMessage(id,green, String);
This will send a message to the id you've typed.
I've noticed you're using playerid for the rest of things which would set them to the player performing the command, you should revise your code.
Re: VIP -
Edin Black - 13.05.2012
Can anyone make me the command ?
I can not more. When a type /setvip to another player, nothings happen.
Please
Re: VIP -
JaKe Elite - 13.05.2012
Do you make sure that the playerid you trying to use in /setvip is connected?
Re: VIP -
Edin Black - 13.05.2012
I send you the FS on pm