SA-MP Forums Archive
[FilterScript] Car Disco. - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] Car Disco. (/showthread.php?tid=437714)



Car Disco. - ofekw2 - 16.05.2013

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;
}



Re: Car Disco. - aznpro12345 - 16.05.2013

Lets go test this out

Edit: Undefined playerid..


Re: Car Disco. - ofekw2 - 16.05.2013

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

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


Re: Car Disco. - zDivine - 17.05.2013

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