veh command help
#1

I Need to put something in this command that is make old car delete and spawn new car help!


Код:
	if(strcmp(cmd, "/veh", true) == 0 && PlayerAdminLevel[playerid] >= 1)
	{
	new car;
	tmp = strtok(cmdtext, idx);
	if(!strlen(tmp)) {
	SendClientMessage(playerid, COLOR_ERROR, "USAGE: /veh (vehid)");
	return 1;
	}
    if(!IsNumeric(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /veh (vehid) ID Must be a number");
    return 1;
    }
	car = strval(tmp);
	if(car < 400 || car > 611) {
	SendClientMessage(playerid, COLOR_ERROR, "Car ID Cant Be Less Than 400 And More Than 611");
	return 1;
	}
	if(IsPlayerInAnyVehicle(playerid)){
	SendClientMessage(playerid,COLOR_ERROR,"You Already Got Car");
	return 1;
	}
	new Float:x, Float:y, Float:z, Float:Angle;
	new s[128];
	GetPlayerPos(playerid, x,y,z);
	acar = CreateVehicle(car, x+3,y,z, Angle, 1, 1, 60000);
	new pname[24];
	new uname[24];
	GetPlayerName(playerid,uname,24);
	GetPlayerName(giveplayerid,pname,24);
	GetPlayerFacingAngle(playerid,Angle);
	format(string,sizeof(string), "You Have Spawned Car %d ",car);
	SendClientMessage(playerid,COLOR_GREEN,string);
	format(s,sizeof(s),"Server %s %s(%d) Has Spawned %d Car",AdminRanks[PlayerAdminLevel[playerid]],uname,playerid,car);
	SaveToFile("car",s);
	return 1;
	}
Reply
#2

pawn Код:
if(strcmp(cmd, "/veh", true) == 0 && PlayerAdminLevel[playerid] >= 1)
    {
    new car;
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /veh (vehid)");
    return 1;
    }
    if(!IsNumeric(tmp)) {
    SendClientMessage(playerid, COLOR_ERROR, "USAGE: /veh (vehid) ID Must be a number");
    return 1;
    }
    car = strval(tmp);
    if(car < 400 || car > 611) {
    SendClientMessage(playerid, COLOR_ERROR, "Car ID Cant Be Less Than 400 And More Than 611");
    return 1;
    }
    if(IsPlayerInAnyVehicle(playerid)){
    SendClientMessage(playerid,COLOR_ERROR,"You Already Got Car");
    return 1;
    }
    new Float:x, Float:y, Float:z, Float:Angle;
    new s[128];
    GetPlayerPos(playerid, x,y,z);
        DestroyVehicle(acar);
    acar = CreateVehicle(car, x+3,y,z, Angle, 1, 1, 60000);
    new pname[24];
    new uname[24];
    GetPlayerName(playerid,uname,24);
    GetPlayerName(giveplayerid,pname,24);
    GetPlayerFacingAngle(playerid,Angle);
    format(string,sizeof(string), "You Have Spawned Car %d ",car);
    SendClientMessage(playerid,COLOR_GREEN,string);
    format(s,sizeof(s),"Server %s %s(%d) Has Spawned %d Car",AdminRanks[PlayerAdminLevel[playerid]],uname,playerid,car);
    SaveToFile("car",s);
    return 1;
    }
Try it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)