17.02.2012, 23:41
Hello reader,
here I am, once again. It maybe looks I ask everything as soon as it doesn't work but I don't, I first try to solve it myself ( As I am new to PAWN I am spending quite a lot time on it so that is why you will still get to see so much questions from me ^^ ). Okay, that is just for the people who think like "Screw him, he just doesn't want to put any effort into it.".
Now, my question. I got a command to create vehicles, that all works fine, nothing wrong with it. Now the problem is, I tried to script a /deleteveh myself, and I sucseeded, for a part. I already got so far that I could delete the vehicle I am inside ( With the help of SA-MP Wiki :P ), but I planned to create a command to "/deleteveh [vehicleid]" ( Ofcourse the IG vehicle ID from /dl and not like ID 400 will delete all Landstalkers but that ID 1 will delete the first vehicle created in the server. ) but I can't get that to work.
Now I am also not sure if that is possible but I guess it is. This is the code I am currently using:
I need to know what I should put behind "vehicle = ......" because I think it will work then .
Best regards,
Jesse
here I am, once again. It maybe looks I ask everything as soon as it doesn't work but I don't, I first try to solve it myself ( As I am new to PAWN I am spending quite a lot time on it so that is why you will still get to see so much questions from me ^^ ). Okay, that is just for the people who think like "Screw him, he just doesn't want to put any effort into it.".
Now, my question. I got a command to create vehicles, that all works fine, nothing wrong with it. Now the problem is, I tried to script a /deleteveh myself, and I sucseeded, for a part. I already got so far that I could delete the vehicle I am inside ( With the help of SA-MP Wiki :P ), but I planned to create a command to "/deleteveh [vehicleid]" ( Ofcourse the IG vehicle ID from /dl and not like ID 400 will delete all Landstalkers but that ID 1 will delete the first vehicle created in the server. ) but I can't get that to work.
Now I am also not sure if that is possible but I guess it is. This is the code I am currently using:
pawn Code:
CMD:deleteveh(playerid, params[])
{
if (IsPlayerAdmin(playerid) == 0)
{
SendClientMessage(playerid, KLEUR_WIT, "You are not an Administrator.");
return 1;
}
else if (isnull(params))
{
SendClientMessage(playerid, KLEUR_WIT, "{B4B5B7}USAGE: /deleteveh [vehicleid]");
return 1;
}
else if (IsPlayerAdmin(playerid) == 1)
{
new vehicleid;
vehicle =
DestroyVehicle(vehicleid);
if(!sscanf(params, "%i", vehicleid))
{
new string[128];
format(string, sizeof(string), "You succesfully deleted vehicle ID: %i", vehicleid);
return 1;
}
}
return 1;
}
Best regards,
Jesse