SA-MP Forums Archive
Gold Rims - 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: Gold Rims (/showthread.php?tid=381941)



Gold Rims - hejsan123 - 01.10.2012

Hello Guys!

I got a problem, i have script this:

CMD:gr(playerid, params[])
{
AddVehicleComponent(GetPlayerVehicleID(playerid),1 080);
SendClientMessage(playerid, COLOR_TWAQUA, "Gold Rims Added");
return 1;
}


But when i add only for admin it's got error. Can someone do it for me here without any error?

Sorry for bad english


Re: Gold Rims - doreto - 01.10.2012

Let me read your mind about error .... wait wait i know now you will post on bottom post the error you get


Re: Gold Rims - trapstar2020 - 01.10.2012

pawn Код:
CMD:gr(playerid, params[])
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
{
AddVehicleComponent(vehicleid, 1080);
SendClientMessage(playerid, COLOR_TWAQUA, "Gold Rims Added");
return 1;
}



Re: Gold Rims - SuperViper - 01.10.2012

pawn Код:
CMD:gr(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an administrator.");
    AddVehicleComponent(GetPlayerVehicleID(playerid),1 080);
    SendClientMessage(playerid, COLOR_TWAQUA, "Gold Rims Added");
    return 1;
}
If you have an admin variable, replace IsPlayerAdmin(playerid) with it.


Re: Gold Rims - mamorunl - 01.10.2012

Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
pawn Код:
CMD:gr(playerid, params[])
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
{
AddVehicleComponent(vehicleid, 1080);
SendClientMessage(playerid, COLOR_TWAQUA, "Gold Rims Added");
return 1;
}
Please don't post. Test your code and you'll find out why.

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
CMD:gr(playerid, params[])
{
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You are not an administrator.");
    AddVehicleComponent(GetPlayerVehicleID(playerid),1 080);
    SendClientMessage(playerid, COLOR_TWAQUA, "Gold Rims Added");
    return 1;
}
If you have an admin variable, replace IsPlayerAdmin(playerid) with it.
Please note the space It is possible that you will get an error with that as well and then the op will be back with another complaint. Seeing as that is how it goes nowadays.


Re: Gold Rims - trapstar2020 - 01.10.2012

lol my bad :P
pawn Код:
CMD:gr(playerid, params[])
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid, 1080);
SendClientMessage(playerid, COLOR_TWAQUA, "Gold Rims Added");
return 1;
}



Re: Gold Rims - CmZxC - 01.10.2012

Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
lol my bad :P
pawn Код:
CMD:gr(playerid, params[])
{
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);
AddVehicleComponent(vehicleid, 1080);
SendClientMessage(playerid, COLOR_TWAQUA, "Gold Rims Added");
return 1;
}
obvious error, COLOR_TWAQUA is not defined.


Re: Gold Rims - trapstar2020 - 01.10.2012

Obviously your stupid cant u see he as it color code defined


Re: Gold Rims - CmZxC - 01.10.2012

Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
he has his own colour code smart ass
didnt notice, sorry.
PS: your english sucks donkey ballz.


Re: Gold Rims - Illusion_gamers - 01.10.2012

Use this one it could work. Just change the "?? ?? ??" To you'r admin level
Код:
CMD:gr(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] <= ??????)
 	{
		return SendClientMessageEx(playerid, COLOR_LIGHTRED, " You are not Authorized to use that command");
	}
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, 0xFFFFFFFF, "You are not driving a vehicle.");
	AddVehicleComponent(GetPlayerVehicleID(playerid),1080);
    SendClientMessage(playerid, 0xFFFFFFFF, "You have added Gold Rims to your vehicle.");
    return 1;
}