SA-MP Forums Archive
Help with Command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help with Command (/showthread.php?tid=91974)



Help with Command - mjr2006 - 17.08.2009

Hello guys!
I'm wanna put that command to only who has the DonateRank up of 3 use!
Can someone help me?
The Command:

Quote:

if (strcmp(cmd, "/comprarv", true) ==0 )
{
if(!IsPlayerInAnyVehicle(playerid)){return 1;}
if(GetCreatorID(vehicleid)!=0)
{
if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid))){SendClientMessage(playeri d,WHITE," Dieses Auto gehoert dir schon!");return 1;}
if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],"dealercar"))
{
if(VehicleSystem[GetCreatorID(vehicleid)][preis] < GetPlayerMoney(playerid))
{
strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid),0,128,12;
GivePlayerMoney(playerid,-VehicleSystem[GetCreatorID(vehicleid)][preis]);
SendClientMessage(playerid,YELLOW," Se divirta com seu novo carro!");
TogglePlayerControllable(playerid,1);
SaveTool();
}
else
{
SendClientMessage(playerid,WHITE,"Vocк precisa de mais dinheiro!");
}
}
else
{
SendClientMessage(playerid,WHITE,"Esse veiculo nгo estб a venda!");
}
}
else
{
SendClientMessage(playerid,WHITE,"Nгo й um carro compravel!");
}
return 1;
}

Thank you!


Re: Help with Command - James_Bauer - 17.08.2009

AccountInfo[playerid][DonatorLevel] > 3) {// Checks for donator level 3 and above
SetPlayerColor(playerid,COLOR_WHITE); // COLOR_WHITE
}
else
{
SendClientMessage(playerid,COLOR_RED,"You're not a level 3 donator! You cannot use this command!");

I think that help ya


Re: Help with Command - mjr2006 - 17.08.2009

And the:
Quote:

if (strcmp(cmd, "/comprarv", true) ==0 )
{
if(!IsPlayerInAnyVehicle(playerid)){return 1;}
if(GetCreatorID(vehicleid)!=0)
{
if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid))){SendClientMessage(playeri d,WHITE," Dieses Auto gehoert dir schon!");return 1;}
if (strmatch(VehicleSystem[GetCreatorID(vehicleid)][owner],"dealercar"))
{
if(VehicleSystem[GetCreatorID(vehicleid)][preis] < GetPlayerMoney(playerid))
{
strmid(VehicleSystem[GetCreatorID(vehicleid)][owner],Spielername(playerid),0,128,12;
GivePlayerMoney(playerid,-VehicleSystem[GetCreatorID(vehicleid)][preis]);
SendClientMessage(playerid,YELLOW," Se divirta com seu novo carro!");
TogglePlayerControllable(playerid,1);
SaveTool();
}
else
{
SendClientMessage(playerid,WHITE,"Vocк precisa de mais dinheiro!");
}
}
else
{
SendClientMessage(playerid,WHITE,"Esse veiculo nгo estб a venda!");
}
}
else
{
SendClientMessage(playerid,WHITE,"Nгo й um carro compravel!");
}
return 1;
}

Where i Put?
Thank you!


Re: Help with Command - coole210 - 18.08.2009

pawn Код:
AccountInfo[playerid][DonatorLevel] > 3)
That means if there OVER 3 not 3 and over...

pawn Код:
AccountInfo[playerid][DonatorLevel] >= 3)
That means if there 3 and over >.>


Re: Help with Command - James_Bauer - 18.08.2009

AccountInfo[playerid][DonatorLevel] > 3) {// Checks for donator level 3 and above
SetPlayerColor(playerid,COLOR_WHITE); // COLOR_WHITE
}
else
{
SendClientMessage(playerid,COLOR_RED,"You're not a level 3 donator! You cannot use this command!");

Put this in your script where you gone put it lol down on your script