SA-MP Forums Archive
Adding somthing to code - 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: Adding somthing to code (/showthread.php?tid=394791)



Adding somthing to code - jakejohnsonusa - 24.11.2012

Hi, I would like to add to this code (which is part of my speedradar for police) a feature that also detects the vehicle model (like Admiral). How would I do this?

Here is the code I have now (which just gets the speed and sends it to the Officer):

pawn Код:
public CheckS(playerid)
{
    new id = s_GetClosestPlayer(playerid,10.0),estr[128];
    if(!IsPlayerConnected(id) || s_IsCop(id) || !active[playerid] || fi[playerid][id] || GetPlayerState(id) != 2 ||!GetSpeed(id)) return SetTimerEx("CheckS",500,0,"i",playerid),1;
    format(estr,128,"%s drives at %d KMH.",GET_PLAYER_NAME(id),GetSpeed(id));
    fi[playerid][id] = true;
    SendClientMessage(playerid,0xAA3333AA,estr);
    SetTimerEx("Unfi",7*1000,0,"ii",playerid,id);
    SetTimerEx("CheckS",500,0,"i",playerid);
    return 1;
}