Posts: 307
Threads: 36
Joined: Mar 2010
Reputation:
0
how i can do that if player type /detach then server send message You detach your (trailer name) code is
// Code
if(strcmp(cmdtext, "/detach", true) == 0)
{
new vehid223;
vehid223 = GetPlayerVehicleID(playerid);
DetachTrailerFromVehicle(vehid223);
new newtext[256];
format(newtext, sizeof(newtext), "You detach your %s"); i want in here
TextDrawSetString(TextdrawText, newtext);
TextDrawShowForPlayer(playerid, TextdrawText);
SetTimer("TextdrawTextRemove", 2000, false);
return 1;
}
Posts: 307
Threads: 36
Joined: Mar 2010
Reputation:
0
Top of script is Trailers names
// Code
new aTrailersNames[212][] = {
{"Article Trailer"},
{"Article Trailer 2"},
{"Article Trailer 3"},
{"Petrol Trailer"},
{"Baggage Trailer A"},
{"Baggage Trailer B"},
{"Tug Stairs Trailer"},
{"Farm Trailer"},
{"Utility Trailer"}
};
// Code
if(strcmp(cmdtext, "/detach", true) == 0)
{
new vehid223;
vehid223 = GetPlayerVehicleID(playerid);
DetachTrailerFromVehicle(vehid223);
new newtext[256];
format(newtext, sizeof(newtext), "You detach your %s", aTrailersNames[model-400]);
TextDrawSetString(TextdrawText, newtext);
TextDrawShowForPlayer(playerid, TextdrawText);
SetTimer("TextdrawTextRemove", 2000, false);
return 1;
}
Posts: 844
Threads: 32
Joined: Apr 2009
Reputation:
0
shouldnt it be possible if u can make a check with 8x getvehiclemodel? then the models of the 8 trailers and return their names?
Posts: 2,593
Threads: 34
Joined: Dec 2007
pawn Код:
new Trailers[10][] = {"Article Trailer","Article Trailer 2","Article Trailer 3","Baggage Trailer \"A\"","Baggage Trailer \"B\"","Farm Trailer","Petrol Trailer","Stairs Trailer","Utility Trailer","Unknown"};
stock TrailerID(v)
{
switch(v)
{
case 435: return 0;
case 450: return 1;
case 591: return 2;
case 606: return 3;
case 607: return 4;
case 610: return 5;
case 584: return 6;
case 608: return 7;
case 611: return 8;
}
return 9;
}
if(!strcmp(cmdtext, "/detach", true))
{
new ID,Model,Trailer;
ID = GetPlayerVehicleID(playerid);
if(IsTrailerAttachedToVehicle(ID))
{
new newtext[64];
Trailer = GetVehicleTrailer(ID);
Model = GetVehicleModel(Trailer);
DetachTrailerFromVehicle(ID);
format(newtext, sizeof(newtext), "You detach your %s",Trailers[TrailerID(Model)]);
TextDrawSetString(TextdrawText, newtext);
TextDrawShowForPlayer(playerid, TextdrawText);
SetTimer("TextdrawTextRemove", 2000, false);
}// else trailer not attached
return 1;
}
+ GetPlayerVehicleSeat + TextdrawText[playerid] not TextdrawText + SetTimerEx not SetTimer