(/pu)utincar command problem - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: (/pu)utincar command problem (
/showthread.php?tid=70526)
(/pu)utincar command problem -
Castle - 25.03.2009
I made this (/pu)tincar command that places a player into the car on the seat you want
The problem is that when you type:
or any other number wich isn't 0/1/2/3 it place the player on the Seat number 1
please help
heres teh Pastebin of the cmd
http://pastebin.com/f1c3e5f8e
Re: (/pu)utincar command problem -
Rks25 - 25.03.2009
Car only has max 3 seats...
So if you place 4, it places at first, and when that guy exits the vehicle, he crashes.
Re: (/pu)utincar command problem -
Rks25 - 25.03.2009
replace this:
if(SeatID <1 || SeatID > 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "Seat number must be between 1-3");
}
with :
pawn Код:
if(SeatID <1 || SeatID > 3)
{
SendClientMessage(playerid, COLOR_GRAD1, "Seat number must be between 1-3");
[b]return 1;[/b]
}
Re: (/pu)utincar command problem -
Shellegg - 25.03.2009
~Mine doesn't work too
anyone can check it for me please? Thanks
pawn Код:
if(strcmp(cmd, "/meternocarro", true) ==0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 1)
{
if(CopOnDuty[playerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Nгo estбs em duty!");
}
if(PlayerCuffed[giveplayerid] == 0)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "O suspeito precisa ser algemado antes de estar posto no carro!");
}
if(IsPlayerInAnyVehicle(playerid))
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "Precisas estar fora do carro para por o suspeito lб dentro.");
return 1;
}
if(IsPlayerConnected(giveplayerid))
{
if (ProxDetectorS(8.0, playerid, giveplayerid))
{
new carid = GetPlayerVehicleID(playerid);
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
return SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/meternocarro [playerid/PartOfName] [seatid]");
giveplayerid = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if (!strlen(tmp))
return SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "/meternocarro [playerid/PartOfName] [seatid]");
new seat = strval(tmp);
if(seat < 0 || seat > 3)
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "O seatid tem de ser entre 1 e 3");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "0 - Condutor");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "1 - Pendura");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "2 - Passageiro");
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "3 - Passageiro");
return 1;
}
new suspect = GetClosestPlayer(playerid);
format(string, sizeof(string), "Foste detido pelo agente %s .", GetPlayerNameEx(playerid));
SendClientMessage(giveplayerid, COLOR_LIGHTYELLOW2, string);
format(string, sizeof(string), "Detes-te o suspeito %s .", GetPlayerNameEx(suspect));
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, string);
PlayerPlayerActionMessage(playerid,suspect,15.0," pega o suspeito e mete-o dentro do carro.");
GameTextForPlayer(giveplayerid, "~r~BUSTED", 2500, 3);
ClearAnimations(giveplayerid);
PutPlayerInVehicle(giveplayerid,carid,seat);
TogglePlayerControllable(giveplayerid, 0);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Precisas estar perto do teu carro!");
return 1;
}
}
else
{
format(string, sizeof(string), "%s nгo estб online", giveplayerid);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}
return 1;
}
Re: (/pu)utincar command problem -
Rks25 - 25.03.2009
Why dont you use his?