/ev command
#1

Here is the code :
PHP код:
CMD:ev(playeridparams[])
{
new 
world GetPlayerVirtualWorld(playerid);
if(
world != 0)
{
    new 
color1color2id[128], string[144];
    if(
sscanf(params"s[64]dd"idcolor1color2)) return SendClientMessage(playerid, ~1"{FF0000}|!| {FF9500}Usage: {FFFFFF}/spawncar (Name) (color1) (color2)");
        new 
car GetVehicleModelIDFromName(id);
        if(
car 400 || car 611) return SendClientMessage(playerid, ~1"Vehicle ID can't be below {FF0000}400 {FFFFFF}or above {FF0000}611");
        new 
Float:XFloat:YFloat:ZFloat:A;
        
GetPlayerPos(playeridXYZ);
        
GetPlayerFacingAngle(playeridA);
        
+= (floatsin(-Adegrees));
        
+= (floatcos(-Adegrees));
        new 
cars CreateVehicle(carXYZ0.0color1color2, -1);
        new 
pint GetPlayerInterior(playerid);
        
LinkVehicleToInterior(carspint);
        new 
pworld GetPlayerVirtualWorld(playerid);
        
SetVehicleVirtualWorld(carspworld);
        
cars++;
        
format(stringsizeof string"Vehicle {FF9500}%s(%d) {FFFFFF}spawned."VehicleList[GetVehicleModel(cars)-400], cars);
        
SendClientMessage(playerid, ~1string);
        
printf(string);
}
else
{
SendClientMessage(playeridCOLOR_RED"You can't use this command right now !");
}
return 
1;

And the defines:
PHP код:
new Vehicle[MAX_PLAYERS];
new 
cars 0;
new 
cars CreateVehicle(carXYZ0.0color1color2, -1); 
There is extra define i know

The other command:
PHP код:
CMD:finish(playeridparams[])
{
if(
Events 0)
{
Events -= 1;
SendClientMessage(playeridCOLOR_GREEN"Event finsihed !");
SetPlayerVirtualWorld(playerid0);
DestroyVehicle(cars);
else
{
SendClientMessage(playeridCOLOR_RED"There isn't any running event !");
}
return 
1;

But when the player type /finish the cars still wehn the evented created again !
Please Help !
Reply
#2

Please Help !!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)