28.05.2012, 11:01
Quote:
Why i can create only one gate
when i try to make antoher one its says "you already created dynamic gate" help me please |
pawn Code:
CMD:placegate( playerid, params[] )
{
if( isnull( params) )
return SendClientMessage( playerid, -1, "Syntax: /placegate [password]" );
if( !strval( params ) )
return SendClientMessage( playerid, -1, "You need to input numbers." );
if( IsPlayerInAnyVehicle( playerid ) )
return SendClientMessage( playerid, -1, "You need to exit your vehicle." );
// if you want to place more than 1 gate per player comment this code
/*new szName[24];
GetPlayerName( playerid, szName, 24 );
for( new i = 0; i != MAX_GATES; i++ )
if( GateInfo[i][gCreated] == 1 )
if( !strcmp( szName, GateInfo[i][gPlacedBy], true ) )
return SendClientMessage( playerid, -1, "You already placed a movable gate." );
else
continue;*/
new Float:pPos[4];
GetPlayerPos( playerid, pPos[0], pPos[1], pPos[2] );
GetPlayerFacingAngle( playerid, pPos[3] );
CreateGate( playerid, strval( params ), pPos[0], pPos[1], pPos[2], pPos[3] );
SendClientMessage( playerid, -1, "You succesfully created a movable gate. Use /gopen or /gclose." );
return 1;
}