30.01.2013, 22:36
(
Последний раз редактировалось Eley999; 31.01.2013 в 21:00.
)
Hello, iam having problem with putting script in right order to create command /givecarto giving car to other player, maybe could help me?
I have this:
I have this:
pawn Код:
CMD:givecarto(playerid, params[])
{
new playerb;
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USE: /givecarto [playerid]");
if(!PlayerInfo[playerid][pVeh]) return SendClientMessage(playerid, COLOR_GREY, "You dont own a car.");
if(!IsPlayerLoggedIn(playerb) && !IsPlayerNPC(playerb)) return SendClientMessage(playerid, COLOR_GREY, "There a no such player.");
if(PlayerInfo[playerb][pVIP] >= 2)
{
if(PlayerInfo[playerb][vModel] && PlayerInfo[playerb][vVModel])
{
SendClientMessage(playerid, COLOR_GREY, "* The player owned a car.");
return 1;
}
}
if(PlayerInfo[playerb][vModel])
{
SendClientMessage(playerid, COLOR_GREY,"* The player owned 2 cars.");
return 1;
}
if(PlayerInfo[playerb][pVIP] >= 2 && PlayerInfo[playerb][vModel])
{
PlayerInfo[playerb][pVVeh] = PlayerInfo[playerid][pVeh];
SetVehicleParamsEx(PlayerInfo[playerb][pVVeh], 0, 0, 0, 1, 0, 0, 0);
PlayerInfo[playerb][vVLocked] = 1;
PlayerInfo[playerb][vVModel] = PlayerInfo[playerid][pVeh];
GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vVX], PlayerInfo[playerb][vVY], PlayerInfo[playerb][vVZ]);
GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);
PlayerInfo[playerb][vVC1] = 0;
PlayerInfo[playerb][vVC2] = 0;
}else{
PlayerInfo[playerb][pVeh] = PlayerInfo[playerid][pVeh];
SetVehicleParamsEx(PlayerInfo[playerb][pVeh], 0, 0, 0, 1, 0, 0, 0);
PlayerInfo[playerb][vLocked] = 1;
PlayerInfo[playerb][vModel] = PlayerInfo[playerid][pVeh];
GetVehiclePos(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vX], PlayerInfo[playerb][vY], PlayerInfo[playerb][vZ]);
GetVehicleZAngle(PlayerInfo[playerb][pVeh], PlayerInfo[playerb][vA]);
PlayerInfo[playerb][vC1] = 0;
PlayerInfo[playerb][vC2] = 0;
}
PlayerInfo[playerid][pVeh] = 0;
PlayerInfo[playerid][vModel] = 0;
PlayerInfo[playerid][vX] = 0;
PlayerInfo[playerid][vY] = 0;
PlayerInfo[playerid][vZ] = 0;
PlayerInfo[playerid][vA] = 0;
PlayerInfo[playerid][vC1] = 0;
PlayerInfo[playerid][vC2] = 0;
SendClientMessage(playerid, COLOR_GREEN, " You dont own that car.");
return 1;
}