[FilterScript] Car Disco.
#1

This system is Change Vehicle Color
Код:
#include <a_samp>
new gDisco[MAX_VEHICLES],gTimer[MAX_PLAYERS];
public OnPlayerCommandText(playerid, cmdtext[])
{
    new v = GetPlayerVehicleID(playerid);
    if(strcmp("/Disco", cmdtext, true, 10) == 0)
    {
        gDisco[v] = gDisco[v]? 1:0;
        if(!IsPlayerInAnyVehicle(v))return SendClientMessage(playerid,-1,"u not in vehicle");
        else gDisco[v] = 1;
        Disco(v);
        return 1;
    }
    return 0;
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(gDisco[vehicleid] == 1)return SendClientMessage(playerid,0xFFFFFAA,"in this vehicle the disco sys is open");
    return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
    if(gDisco[vehicleid] == 1)return SendClientMessage(playerid,0xFFFFFAA,"u exit from your vehicle and the disco is open");
    return 1;
}
Disco(vehicleid)
{
    if(gDisco[vehicleid] == 0)return 0;
    else KillTimer(gTimer[playerid]);
     gTimer[playerid] = SetTimerEx("Disco",1000,1,"d",vehicleid);
    ChangeVehicleColor(vehicleid,random(255),random(255));
    return 1;
}
Reply
#2

Lets go test this out

Edit: Undefined playerid..
Reply
#3

Quote:
Originally Posted by aznpro12345
Посмотреть сообщение
Lets go test this out

Edit: Undefined playerid..
yes i create this sys to vehicle not from player.
Reply
#4

Lol, he took this feature from s0nicTz sobiet, "Crazy Car".
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)