SA-MP Forums Archive
Help with command. - 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: Help with command. (/showthread.php?tid=390917)



Help with command. - Mustafa6155 - 08.11.2012

this is my command
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(!strcmp(cmdtext, "/searchcar", true))
    {
            new vehicleid = GetPlayerVehicleID(playerid);
   			if(GetVehicleModel(vehicleid) == 523 && GetVehicleModel(vehicleid) == 427 && GetVehicleModel(vehicleid) == 490 && GetVehicleModel(vehicleid) == 528 && GetVehicleModel(vehicleid) == 596 && GetVehicleModel(vehicleid) == 597 && GetVehicleModel(vehicleid) == 598 && GetVehicleModel(vehicleid) == 599 && GetVehicleModel(vehicleid) == 601)
  			SendClientMessage(playerid, -1, "Searched an car found something??");
  			GivePlayerWeapon(playerid, PossibleRandomWeapons[r][0], PossibleRandomWeapons[r][1]);
  			return 1;
Not tested but how make agait that command but then
Код:
With other cars and other thing ?? ik he need to return to that command please help but i dont now how to do?



Re: Help with command. - Alex Magaсa - 08.11.2012

use zeex (include)(zcmd)
PHP код:
#include <zcmd>
CMD:searchcar(playeridparams[]) {

    if(
PlayerInfo[playerid][pAdmin] >= 2) {

        
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"--------------------------------------------------------------------------------------------------------------------------------");
        
SendClientMessageEx(playeridCOLOR_WHITE"Vehicle Search:");

        new
            
string[128];

        if(
isnull(params)) return SendClientMessageEx(playeridCOLOR_GREY"No keyword specified.");
        if(!
params[2]) return SendClientMessageEx(playeridCOLOR_GREY"Search keyword too short.");

        for(new 
vsizeof(VehicleName); v++) {
            if(
strfind(VehicleName[v], paramstrue) != -1) {

                if(
isnull(string)) format(stringsizeof(string), "%s (ID %d)"VehicleName[v], v+400);
                else 
format(stringsizeof(string), "%s | %s (ID %d)"stringVehicleName[v], v+400);
            }
        }

        if(!
string[0]) SendClientMessageEx(playeridCOLOR_GREY"No results found.");
        else if(
string[127]) SendClientMessageEx(playeridCOLOR_GREY"Too many results found.");
        else 
SendClientMessageEx(playeridCOLOR_WHITEstring);

        
SendClientMessageEx(playeridCOLOR_LIGHTBLUE"--------------------------------------------------------------------------------------------------------------------------------");
    }
    return 
1;




Re: Help with command. - Mustafa6155 - 08.11.2012

Its not for the admins for every body and if he enter an polcie car is difrend and he enter an race car difrend


Re: Help with command. - Alex Magaсa - 08.11.2012

well just change pAdmin im using this in some of my scripts to find the vehicle.!
Well i don't really understand what you said here:
If he enter a police car is diffirent and if he enter an race car is diffirent? what you mean?


Re: Help with command. - Mustafa6155 - 09.11.2012

yea i mean he enter an Gangsta vehicle he do /searchcar he get other things in other cars??