21.02.2011, 04:32
(
Последний раз редактировалось Ponchik; 21.02.2011 в 05:09.
)
if (strcmp("/snow", cmdtext, true, 5) == 0)
it will work for /snow[anything] (/snowrfgerg534tr will call this string)
so...
if (strcmp("/snowon", cmdtext, true, 7) == 0)
and
if (strcmp("/snowoff", cmdtext, true, 8 ) == 0)
will never called
P.S. and nothing snow to me
i think all who writed "cool script" and somethink like this even not tested it, wite just for post =\
=====
i made like this
just to test, and its not work, i see nothing >_<
ok, let's imagine that its work
1) Why in OnPlayerConnect you attach object to all player if you have command to turn off snow for all
2) For command /snow you have check IsPlayerAdmin(i) in incorrect spot, all users can use this command, but its turn on snow only for admins.
3) In /nosnow (that will never called, but let's use our imagination)
3.1) You destroy all objects, so why you need array SnowOff[MAX_PLAYERS] you dont use it, you just destroy objects
3.2) If you destroyed object in /nosnow and /snowoff, why you don't create it in /snow and /snowon? It will be very cool problems, you saved ID of object, then delete it, then other FS will create other object with ID thath you saved, and to some player, thath connected, you script will attach some random object, that created by other FS
?) If you have SnowOff[i] to detect fot what player use snow, for what not, reset it in OnPlayerDisconnect
======
just show you your errors...
P.P.S. anybody tested it? it works? i can't make it work
P.P.P.S. work for me like thath:
use this only for testing, objects not destroying
it will work for /snow[anything] (/snowrfgerg534tr will call this string)
so...
if (strcmp("/snowon", cmdtext, true, 7) == 0)
and
if (strcmp("/snowoff", cmdtext, true, 8 ) == 0)
will never called
P.S. and nothing snow to me
i think all who writed "cool script" and somethink like this even not tested it, wite just for post =\
=====
i made like this
Код:
#include <a_samp> public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/snow", cmdtext, true, 5) == 0) { new obj_id, msg[64]; obj_id = CreatePlayerObject(playerid, 18864, 0, 0, 0, 0, 0, 0); AttachObjectToPlayer(obj_id, playerid, 1.5, 0.5, 0, 0, 1.5, 2); format(msg,sizeof(msg),"Object got ID %i", obj_id); SendClientMessage(playerid,0xFFBF00FF,msg); return 1; } return 0; }
ok, let's imagine that its work
1) Why in OnPlayerConnect you attach object to all player if you have command to turn off snow for all
2) For command /snow you have check IsPlayerAdmin(i) in incorrect spot, all users can use this command, but its turn on snow only for admins.
3) In /nosnow (that will never called, but let's use our imagination)
3.1) You destroy all objects, so why you need array SnowOff[MAX_PLAYERS] you dont use it, you just destroy objects
3.2) If you destroyed object in /nosnow and /snowoff, why you don't create it in /snow and /snowon? It will be very cool problems, you saved ID of object, then delete it, then other FS will create other object with ID thath you saved, and to some player, thath connected, you script will attach some random object, that created by other FS
?) If you have SnowOff[i] to detect fot what player use snow, for what not, reset it in OnPlayerDisconnect
======
just show you your errors...
P.P.S. anybody tested it? it works? i can't make it work
P.P.P.S. work for me like thath:
Код:
#include <a_samp> public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/snow", cmdtext, true, 5) == 0) { new obj_id, msg[64], Float:sx, Float:sy, Float:sz; GetPlayerCameraPos(playerid,sx,sy,sz); obj_id=CreatePlayerObject(playerid,18864, sx, sy, sz-5, 0.0, 0.0, 0.0, 300.0); format(msg,sizeof(msg),"Object got ID %i", obj_id); SendClientMessage(playerid,0xFFBF00FF,msg); return 1; } return 0; }