SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 21/09/2018, 07:11 PM   #1
SaMuRy
Little Clucker
 
Join Date: Sep 2018
Posts: 45
Reputation: 0
Default Need help with Specting vehicle !

Hello guys


Code:
Quote:
if(!strcmp(cmd, "/speccar", true) || !strcmp(cmd, "/carspec", true))
{
if(userdata[playerid][userowncar] == 0 && userdata[playerid][userowncar2] == 0 && userdata[playerid][userowncar3] == 0 && userdata[playerid][userowncar4] == 0) return SendClientMessage(playerid,COLOR_KRED,"ERROR: אין בבעלותך רכבים");
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, -1, "USAGE: /SpecCar [1-3]");


if(!strcmp(tmp, "1", true))
{
if(userdata[playerid][userowncar] == 0) return SendClientMessage(playerid,COLOR_KRED,"! רכב זה לא בבעלותך");
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, vehdata[strval(tmp)][syscarid]);
ShowPlayerDialog(playerid, 66, DIALOG_STYLE_MSGBOX, "{FF9900}Car Spectate", "{FFFFFF}! כעת אתה צופה ברכבך הראשון\n{FF9900}/SpecOff{FFFFFF} - על מנת לצאת ממצב זה רשום", "Close", "");
InCSpec[playerid] = 1;
}

if(!strcmp(tmp, "2", true))
{
if(userdata[playerid][userowncar2] == 0) return SendClientMessage(playerid,COLOR_KRED,"! רכב זה לא בבעלותך");
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, vehdata[strval(tmp)][syscarid]);
ShowPlayerDialog(playerid, 66, DIALOG_STYLE_MSGBOX, "{FF9900}Car Spectate", "{FFFFFF}! כעת אתה צופה ברכבך השני\n{FF9900}/SpecOff{FFFFFF} - על מנת לצאת ממצב זה רשום", "Close", "");
InCSpec[playerid] = 1;
}

if(!strcmp(tmp, "3", true))
{
if(userdata[playerid][userowncar3] == 0) return SendClientMessage(playerid,COLOR_KRED,"! רכב זה לא בבעלותך");
TogglePlayerSpectating(playerid, 1);
PlayerSpectateVehicle(playerid, vehdata[strval(tmp)][syscarid]);
ShowPlayerDialog(playerid, 66, DIALOG_STYLE_MSGBOX, "{FF9900}Car Spectate", "{FFFFFF}! כעת אתה צופה ברכבך השלישי\n{FF9900}/SpecOff{FFFFFF} - על מנת לצאת ממצב זה רשום", "Close", "");
InCSpec[playerid] = 1;
}

return 1;
}
Well, the problem is, when I am using /SpecCar for example /SpecCar 1 - It will let me to spec different player's vehicle instead mine. another example - My ign is: SaMuRy. and there are an user that called "StorNN".
And when I am using /SpecCar 1 (There are 3 slots for vehicles). as I said "You are watching StroNN Vehicle (#1)" Instead: You're watching SaMuRy Vehicle (#1).
You guys maybe figured out
SaMuRy is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Include] vFunc - Synced random vehicle colors (-1), GetVehicleColor and more vehicle-related functions (UPDATED FOR 0.3.7) MP2 Includes 41 22/07/2016 08:17 AM
[FilterScript] tAxI's Xtreme Vehicle Management - Advanced Vehicle Ownership and Administration Menu CJay9209 Filterscripts 13 16/10/2015 07:21 AM
Vehicle System: Vehicle spawns with saved Modelid and color1+2 but not on the XYZA DizZykeee Scripting Help 14 23/09/2015 09:16 PM
Angle Issues: Setting a attached object on a vehicle to face a vehicle Kar Scripting Help 2 11/07/2012 12:37 AM
[FilterScript] [FS] tAxI's Vehicle Streamer [v0.2] - add unlimited vehicle spawns and models!!! cptnsausage Filterscripts 205 31/07/2010 05:29 AM


All times are GMT. The time now is 02:21 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.