20.11.2010, 00:38
(
Last edited by ipsBruno; 30/11/2010 at 11:49 AM.
)
Code of Racing | Is PHP
PHP Code:
<?php
$cord1 = $_POST["ucord"];
$cord2 = $_POST["pcord"];
$cord3 = $_POST["rcord"];
$comando = $_POST["command"];
$checktotais = $_POST["checks"];
$exp = explode("\n", $cord3);
$format = "";
foreach($exp as $linha)
{
$format .= "{ $linha },";
}
echo "
Cуdigo Gerado:
<textarea NAME=dkn>
//- www.feksquad.blogspot.com -//
//- Race Creator in PHP By DraKiNs -//
#include <a_samp>
#define TOTAIS_CHECKS $checktotais
new Stats[MAX_PLAYERS];
new bool:PlayerRa[500];
new Float:Checkpoints[TOTAIS_CHECKS][3] =
{
{ $cord2 },
$format
{ $cord1 }
};
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, \"$comando\", true))
{
SendClientMessage(playerid, 0xFFFFFFFF, \"SERVER: Vocк foi para o Race\");
PlayerRa[playerid] = true;
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
Stats[playerid]++;
return true;
}
return false;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(PlayerRa[playerid] == true)
{
Stats[playerid]++;
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid, 0, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
}
if(Stats[playerid] == TOTAIS_CHECKS-1 && PlayerRa[playerid] == true)
{
DisablePlayerRaceCheckpoint(playerid);
SetPlayerRaceCheckpoint(playerid,1, Checkpoints[Stats[playerid]][0], Checkpoints[Stats[playerid]][1], Checkpoints[Stats[playerid]][2], Checkpoints[Stats[playerid]+1][0], Checkpoints[Stats[playerid]+1][1], Checkpoints[Stats[playerid]+1][2], 10);
SendClientMessage(playerid, 0xFFFFFFFF, \"SERVER: Vocк esta quase acabando a corrida!!\");
}
if(Stats[playerid] == TOTAIS_CHECKS && PlayerRa[playerid] == true)
{
PlayerRa[playerid] = false;
Stats[playerid] = 0;
SendClientMessage(playerid, 0xFFFFFFFF, \"SERVER: Vocк acabou o Race parabйns\");
DisablePlayerRaceCheckpoint(playerid);
}
return true;
}
</textarea>";