19.10.2011, 14:26
Because there are a lot of teles and can't put it on 1 line, I use this.
Also, use [pawn]
pawn Код:
new TelGeneral[][] =
{
{ "/4drag" },
{ "/aa" },
{ "/aaj" },
{ "/ammu1-11" },
{ "/bar1-2" },
{ "/baysidestunts" },
{ "/boatdock" },
{ "/bounce" },
{ "/bp" },
{ "/bs1-2" },
{ "/buildingjump" },
{ "/cage" },
{ "/garage" },
{ "/club1-3" },
{ "/cthustle" },
{ "/dedm" },
{ "/djam" },
{ "/drift1-19" },
{ "/driftschool" },
{ "/ee" },
{ "/eej" },
{ "/eij" },
{ "/islanddm" },
{ "/lsa" },
{ "/mc" },
{ "/newstunts" },
{ "/newworld" },
{ "/otto" },
{ "/parkour" },
{ "/quarry" },
{ "/rcshop" },
{ "/sfa" },
{ "/sfhall" },
{ "/skydrag" },
{ "/tf" },
{ "/tf2" },
{ "/usj" },
{ "/wa" },
{ "/wang" }
};
pawn Код:
if( !strcmp( cmdtext , "/teles" , true ) ) {
new
dialog[590],
part[37]
;
format( dialog , sizeof(dialog) , "{FFFFFF}%s" , TelGeneral[0] );
for( new i = 1; i < sizeof( TelGeneral ); i++ ) {
format( part , sizeof(part) , "\n%s" , TelGeneral[i] );
strcat( dialog , part , sizeof(dialog) );
}
printf( "[string check] dialog length %d ( size %d )" , strlen( dialog ) , sizeof(dialog) );
// use this to check that the size of dialog is sufficient
ShowPlayerDialog( playerid , 6 , DIALOG_STYLE_LIST , "Teleports" , dialog , "Teleport" , "Cancel" );
return 1;
}
pawn Код:
if(dialogid == 6) {
if(response) {
if(listitem == 0) {
RemovePlayerFromVehicle(playerid);
ResetPlayerWeapons(playerid);
SetPlayerPos(playerid,x,y,z);
GameTextForPlayer(playerid,"",4000,6);
}