08.01.2017, 19:13
Hello!
I just made a car vipname script in my gamemode using ZCMD , it works good for a player,
but when a player assign it to his car it assings to all cars in the server, and after server restart it didn't appear until you do the command again.
So i have 2 bugs over now:
also, i'm new here !
I just made a car vipname script in my gamemode using ZCMD , it works good for a player,
but when a player assign it to his car it assings to all cars in the server, and after server restart it didn't appear until you do the command again.
PHP код:
CMD:vipname(playerid, params[])
{
new text[6], szMessage[256];
new vehicleid = GetPlayerVehicleID(playerid);
if(sscanf(params, "s[50]", text)) return SCM(playerid, COLOR_WHITE, "SYNTAX: /vipname [name]");
if(PlayerInfo[playerid][pPremiumAccount] != 1) return SCM(playerid, COLOR_ERROR, "You don't have a premium account");
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid, COLOR_WHITE, "You aren't in any car.");
if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_ERROR, "You aren't the driver.");
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 411) return SCM(playerid, COLOR_ERROR, "Car must be an Infernus in order to apply this command.");
if(OwnedVeh(vehicleid))
{
vText = CreateObject(19327, -2597.0762, -2638.4270, -5.3536, -87.6999, 90.4001, -87.1805);
SetObjectMaterialText(vText, text, 0, 50, "Arial", 15, 1, 0xFFFFFFFF, 0, 1);
AttachObjectToVehicle(vText, vehicleid, 0.0,-1.9, 0.3, 270.0, 0.0, 0.0);
format(szMessage, sizeof(szMessage), "{F2CF09}Vipname is: '%s'", text);
SCM(playerid, COLOR_YELLOW, szMessage);
}
}
return 1;
}
CMD:removename(playerid, params[])
{
new szMessage[256];
if(PlayerInfo[playerid][pPremiumAccount] == 1)
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetPlayerState(playerid) != PLAYER_STATE_PASSENGER) return SCM(playerid, COLOR_WHITE, "You aren't in a vehicle.");
DestroyObject(vText);
format(szMessage, sizeof(szMessage), "{F2CF09}Car vipname removed with success!");
SCM(playerid, COLOR_RED, szMessage);
}
return 1;
}
- It didn't save
- It attach to all players in server
also, i'm new here !
![Tongue](images/smilies/razz.gif)